How to Get the Values of a Map in JavaScript
In this lesson, we will see how to get the values of a map in JavaScript, sometimes we want to get all the values of a given map in JavaScript so how can we do that?
The values() method
To do that we can use the values() method that returns a Map Iterator Object that contains the values.
const myMap = new Map([['name','john'],['age',22],['city','london']]);
const mapValues = myMap.values();
console.log(mapValues.next().value);
//john