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

Syntax error on numbers with underscores, such as 1_000_000 #3606

Closed
coolaj86 opened this issue Feb 14, 2022 · 1 comment
Closed

Syntax error on numbers with underscores, such as 1_000_000 #3606

coolaj86 opened this issue Feb 14, 2022 · 1 comment

Comments

@coolaj86
Copy link
Contributor

coolaj86 commented Feb 14, 2022

As with other modern languages, JavaScript numbers may contain _.

Examples:

let population = 8_501_000_000;
let cents = 1_000_000_00;

jshint doesn't seem to be able to parse numbers that use underscores. It fails on the first digit whenever underscores are used:

[jshint] Unexpected '1'. [E]
@jugglinmike
Copy link
Member

Thanks for taking the time to file an issue! The language feature you are looking for is called "numeric separators", and if you search this project's issue tracker for that term, you'll find a corresponding feature request. In order to keep things organized, I'm going to close this issue as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants