I'm there in JavaScript for a long time & it still gives me new things to learn.
According to me, the following line should print the same array back, perhaps it doesn't -
console.log([2, 2, 2, 2, 2, 2].map(parseInt));
// output => [2, NaN, NaN, 2, 2, 2]
console.log([2, 2, 2, 2, 2, 2].map((num) => parseInt(num)));
// output => [2, 2, 2, 2, 2, 2]
Could anyone please help me understand this?