JSFiddle - React, Tailwind, and code Playground

by Anik Islam Abhi

JavaScript

var champions={ '32': { played: 1, image: 'Amumu.png', won: 0 },
  '60': { played: 5, image: 'Elise.png', won: 3 },
  '79': { played: 4, image: 'Gragas.png', won: 3 },
  '245': { played: 1, image: 'Ekko.png', won: 0 },
  '254': { played: 2, image: 'Vi.png', won: 1 },
  '421': { played: 2, image: 'RekSai.png', won: 0 },
  // order is an array where I pushed all the objects image values
  order: 
   [ 'Amumu.png',
     'Elise.png',
     'RekSai.png',
     'Ekko.png', 
     'Gragas.png',
     'Vi.png' ]
};
champions.order.sort();
champions.order=champions.order.map(function(x){
    return Object.keys(champions).find(function(y){
       return champions[y].image == x;    
    });
});
console.log(champions);