i have myData map as below
var myData = new Object();
myData[10427] = \"Description 10427\";
myData[10504] = \"Description 10504\";
myData[10419] = \"D
ES6 Maps preserves the insertion order.
The set method is used for setting the key value pairs
var myData = new Map();
myData.set(10427, "Description 10427");
myData.set(10504, "Description 10504");
myData.set(10419, "Description 10419");
Map keys and values are printed using
myData.forEach((value,key) => console.log(key, value));
This will print the keys and values in the insertion order
Objects are unordered in JS. Use an array if order matters.
var myData = [];
myData.push({ "number": 10427, description: "Description 10427" });