Skip to content
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

Use Number instead of parseInt #6593

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

Latropos
Copy link
Contributor

@Latropos Latropos commented Oct 11, 2024

Summary

Replace parseInt with Number, as the second function correctly handles empty string and undefined.

Number(null) = 0
Number('') = 0
parseInt(null) = NaN

Test plan

@Latropos Latropos marked this pull request as ready for review October 11, 2024 15:46
@bartlomiejbloniarz bartlomiejbloniarz added this pull request to the merge queue Oct 15, 2024
Merged via the queue into main with commit e9b6187 Oct 15, 2024
10 checks passed
@bartlomiejbloniarz bartlomiejbloniarz deleted the acynk/use_number_instead_of_parseInt branch October 15, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants