Hacker News new | ask | show | jobs
by Raed667 1967 days ago
> map passes three arguments into parseInt()

That is how it is supposed to work, that's how it would also work in Java (and probably other languages but I don't know)

You want to pass parameters to suit your particular need you pass them explicitly:

  ['1', '2', '10'].map(i => parseInt(i))
1 comments

Adding on to this comment, here's the MDN docs that show the signature of the callback function that is passed into the `map` function https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...