How to workaround Objects vs arrays in JavaScript for key/value pairs?

JavascriptObject Oriented ProgrammingFront End Technology

Store it like the following −

var players = {
600 : 'Sachin',
};

For key/ value pairs, we have used the above solution, since we wanted a one-to-one. We did this to use the key as a lookup key. You can also add more values like this −

var players = {
900 : 'Sachin',
}