I want to use a map to store some data but I want to preserve the order in which they come from the API array:
let people = [{ name: "jordan", age: 33}, { name: "rich", age: 23} ]; // comes from API
let map = new Map();
for (let x = 0; x < people.length; x++) {
map.set(person.name, person.age)
}
I now have a map of those:
// console.log(map)
// Map(2) {'jordan' => 33, 'rich' => 23}
if I iterate through that map later on using a for of loop, is the order of the Entries guaranteed in that I would be sure the first age would always be 33?