3 ms·
> 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'
by Raed667 6y 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))
- dmlittle 6y agoAdding 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/Reference/Global_Objects/Array/map#parameters https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...