If I map through an array using parseInt
it returns unexpected and incorrect results:
console.log(["1234-04-23", "1234", "04", "23"].map(parseInt))
// => [1234, NaN, 0, 2]
but redundantly adding an arrow function wrapper works as expected
console.log(["1234-04-23", "1234", "04", "23"].map(e => parseInt(e)))
// => [1234, 1234, 4, 23]
These two statements should behave identically, so why does the first one break?