Answers for "es6 map usin index"

3

es6 map usin index

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


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

console.log(map);
Posted by: Guest on July-10-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language