js loop over map iterator code example
Example 1: js loop trough map
for (let key of map) {
console.log(key);
}
Example 2: use map to loop through an array
let squares = [1,2,3,4].map(function (val) {
return val * val;
});
// squares will be equal to [1, 4, 9, 16]