I'm trying to convert an object to list of key-value pairs using Object.entries and then i loop each of the entry, everything is fine except the order of result is different with the object i give when then the key is like "06" or "01" or else that start with "0"
This is tested on NodeJs V10.16.0, UTF-8 character set.
const obj1 = {
'01': "val1",
"06": "val6",
"13": "val13",
"88": "val88",
"100": "val100"
}
Object.entries(obj1).forEach(([k, v]) => {
console.log(k + "-" + v)
})
The result of code above will be :
13-val13
88-val88
100-val100
01-val1
06-val6
I expect the output to be the in the same order as the object i give,like following:
01-val1
06-val6
13-val13
88-val88
100-val100
This thing only happen when the property key in the object start with "0" another type of property is just fine so far. Please help what is it actually?