What is the output?
console.log([1, 2, 3].map(parseInt));
- [1, NaN, NaN]
- [1, 2, 3]
- [NaN, NaN, NaN]
- [1, 2, NaN]
map passes the index as radix: parseInt('2',1) and parseInt('3',2) are both NaN.
Play Problem Solving ▸
console.log([1, 2, 3].map(parseInt));