Índice de usin map map eS6

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


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

console.log(map);
Graceful Grivet