Will Boyd @codersblock.com · Nov 15

Heads up, #JavaScript allows underscores in numbers to make them easier to read. Has no effect on the actual value.

96 likes 13 replies

?

Replies

Andrew Aquino · Nov 15

related re: readbility: I’d forgotten you could use scientific notation for JS numbers then recently I saw 2000 (milliseconds) written as 2e3 in the Bluesky source. such a great idea

Munakas the nerd · Nov 18

Works in python, too

Clayton’s account · Nov 15

Easy to forget, great to remember

@uglywebsites.bsky.social · Nov 19

I did not know this. Thanks for the post.

Matt S · Nov 15

You can also configure eslint to auto fix this as well and you never have to think about it again 👍 github.com/sindresorhus...

Paweł Ludwiczak · Nov 15

nice, now i know i can put num variables like 0_1_2_3_4_5_6_7_8_9 to piss off whoever will be reviewing my PRs 🙌

Adam Kuhn · Nov 15

we want emojis

Peter Cruckshank (he/him) · Nov 15

This was made for people like me 💯👏🏻 And I guess lots of people who see a HUGE number and is like "can we get some kind of separation?" Yes 🙌🏻

Tyler Jones · Nov 15

I had no idea. Thanks for sending this!

Peter Hilton · Nov 15

Now do U+202F NARROW NO-BREAK SPACE as well 😅 hilton.org.uk/blog/correct...

Kevin Berridge · Nov 16

I did not know this!

ABR · Nov 16

Ada and Go, too! And modern C++ allows the use of single-quotes for this purpose.