In javascript object is a type of variable that has the capability of storing data as a property and its value.
let obj = {
0: "value"
}
//is the same as
let obj = {
"0": "value"
}
//and vice-versa.
let obj = {
"0": 1,
0: 2
};
console.log(obj); // {0: 2}
in this code block, you write different values for the same property "0".
so, the last value you used will be the value for the property "0" (i.e 2).
//In simple, you are writing
let obj = {
"0": 2
}
//
let obj = {
0: 2,
"0": 1
};
//if you use this code template
console.log(obj[0]); //will give an object {0 : 1}