Say I just want a variable to hold a bunch of information, and the order is not important. For example, i have a variable players that hold all the information of players in a game. If I use an object to hold all the information, isn't it better than using an array to do so in every possible way?
var players = [{ name: 'john', age: '10' }, { name: 'lily', age: '11' }];
versus
var players = { john: { name: 'john', age: '10' }, lily: { name: 'lily', age: '11' } };
If I count the number of players, or to access/edit a player's information directly, isn't using object better than array in every possible way?
If so, can object literally replace array in any non-ordered situation?
players.filter(where('name', 'john')), and still have a nice collection to work with.