Skip to content

docs: clarify map(parseInt) example with explicit radix #916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from

Conversation

KeenoLee
Copy link

Use an arrow-function callback to explicitly forward only the string and a radix of 10 to parseInt:

// GOOD: we only forward the string (and an explicit radix)
['11','5','3'].map(n => parseInt(n, 10)); // [11, 5, 3]

Use an arrow-function callback to explicitly forward only the string and a radix of 10 to parseInt:

```js
// GOOD: we only forward the string (and an explicit radix)
['11','5','3'].map(n => parseInt(n, 10)); // [11, 5, 3]
@vapier vapier added the lang:ts The TypeScript language label Apr 24, 2025
Shorten the “GOOD” example comment to its original concise form, per maintainer feedback:
@vapier
Copy link
Member

vapier commented Apr 25, 2025

i checked internally and it looks like we also ran into this issue. unfortunately they switched to using an internal API, so i've asked them to tweak it again to address your feedback while being usable externally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang:ts The TypeScript language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants