Map.prototype.values()
This
method return all the values in the map in insertion order.
Example
var
values = countriesMap.values();
for(value
of values){
console.log(value);
}
Find
the below working application.
var countriesMap = new Map(); countriesMap.set("Bahrain", "Manama"); countriesMap.set("Cameroon", "Yaounde"); countriesMap.set("Norway", "Oslo"); countriesMap.set("India", "New Delhi"); var values = countriesMap.values(); for(value of values){ console.log(value); }
Output
Manama
Yaounde
Oslo
New
Delhi
No comments:
Post a Comment