map = new Map();
map.set('key1', 'value1');
map.set('key2', 'value2');
for (let [key, value] of map.entries()) {
console.log(key + ' - ' + value)
}
let map1 = new Map();
map1.set('name', 'Jack');
map1.set('age', '27');
// looping through Map
for (let [key, value] of map1) {
console.log(key + '- ' + value);
}
let map = new Map();
map.set('key1', 'value1');
map.set('key2', 'value2');
for (let [key, value] of map.entries()) {
console.log(key + ' - ' + value)
}
Map<String, String> map = ...
for (Map.Entry<String, String> entry : map.entrySet()) {
System.out.println(entry.getKey() + "/" + entry.getValue());
}
map.values((value) => /* do whatever with value */)
for (let [key, value] of map.entries()) {
console.log(key, value);
}
map.forEach(function(value, key) {
console.log(key + ' = ' + value);
})