News for hackers. Stuff that matters.
Re:Strange TypeScript Behavior by Raed667 on Friday February 05, 2021 @03:02PM (#26040548)
> 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))
Re:Strange TypeScript Behavior by dmlittle on Friday February 05, 2021 @04:35PM (#26041506)
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...