const arr = [1, 2, 3];
const log = [];
const result = arr.map((x, i) => {
if (i === 0) arr.push(4);
log.push(x);
return x * 2;
});
console.log(result.join(','), log.join(','), arr.join(','));
Post #3531
898
CHALLENGE
- ❤ 4
- 🔥 2
- 👍 1