The JavaScript map values() method is used to retrieve an object of Map iterator that contains the values for each element.
Syntax:
mapObj.values()
Return:
An object of Map iterator.
Example:
<!DOCTYPE html> <html> <body> <script> var map=new Map(); map.set('a',"GOOD MORNING"); map.set('b',"GOOD AFTERNOON"); map.set('c',"GOOD EVENING"); map.set('d',"GOOD NIGHT"); var itr= map.keys(); for(i=0;i<map.size;i++){ document.writeln(itr.next().value+"<br>"); } </script> </body> </html>