Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

map forEach js

    // Creating a map using Map object
    let mp=new Map()
     
    // Adding values to the map
    mp.set("a",1);
    mp.set("b",2);
    mp.set("c",3);
     
    // Logging map object to console
    mp.forEach((values,keys)=>{
      console.log({ values }, { keys });
    })
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #map #forEach #js
ADD COMMENT
Topic
Name
5+4 =