Answers for "use map as a value javascript"

0

js new map with values

new Map([
  [1, 'one'],
  [2, 'two'],
  [3, 'three'],
])
Posted by: Guest on June-28-2021
2

functions in map javascript

const map = new Map();

function foo() {
 return "Hello World!"; 
}

map.set("foo", foo);

console.log(map.get("foo")()); // Output: "Hello World!
Posted by: Guest on May-13-2020

Code answers related to "use map as a value javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language