Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get index in map javascript

const array = [1, 2, 3, 4];

const map = array.map((x, index) => {
  console.log(index);
  return x + index;
});

console.log(map);
 
PREVIOUS NEXT
Tagged: #index #map #javascript
ADD COMMENT
Topic
Name
6+9 =