Answers for "set and map in javascript"

7

how to use the map method in javascript

const numbers = [1, 2, 3, 4, 5]; 

const bigNumbers = numbers.map(number => {
  return number * 10;
});
Posted by: Guest on April-08-2020
0

map and set in javascript

map.keys() // The keys() method returns the keys
Posted by: Guest on June-13-2021
0

map and set in javascript

const map = new Map([
  [1970, 'bell bottoms'],
  [1980, 'leg warmers'],
  [1990, 'flannel'],
])
Posted by: Guest on June-13-2021
0

map and set in javascript

map.values() // The values() method returns the values:
Posted by: Guest on June-13-2021
0

map and set in javascript

// Map
Map.prototype.forEach((value, key, map) = () => {}

// Array
Array.prototype.forEach((item, index, array) = () => {}
Posted by: Guest on June-13-2021

Browse Popular Code Answers by Language