Code QuizBeginner

map passes (value, index): the parseInt trap

Passing parseInt straight to map misuses the index as a radix, producing surprising NaN results.

Codejavascript
const strings = ['1', '2', '3'];
const numbers = strings.map(parseInt);
console.log(numbers); // expected [1, 2, 3]

The result is [1, NaN, NaN] instead of [1, 2, 3]. What is the bug?