js dictionary for each code example
Example 1: javascript for loop over dictionary
var dict = {'a': 1, 'b': 2, 'c' : 3};
for([key, val] of Object.entries(dic)) {
console.log(key, val);
}
Example 2: javascript loop over dictionary
for (const [key, value] of myMap.entries()) {
console.log(key, value);
}