Answers for "js mapo"

11

javascript map

function listFruits() {
  let fruits = ["apple", "cherry", "pear"]
  
  fruits.map((fruit, index) => {
    console.log(index, fruit)
  })
}

listFruits()

// https://jsfiddle.net/tmoreland/16qfpkgb/3/
Posted by: Guest on June-07-2020
4

javascript map

The map() method creates a new array with the results of calling a provided function on every element in the calling array.
Posted by: Guest on December-22-2019
-2

map javascript

miMapa.forEach(function(valor, clave) {
  console.log(clave + ' = ' + valor);
});
// Mostrará 2 logs; el primero con "0 = cero" y el segundo con "1 = uno"
Posted by: Guest on February-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language