Skip to content

Commit 3b2d064

Browse files
committed
Add numeric-separators til
1 parent d1baf76 commit 3b2d064

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

javascript/numeric-separators.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
date: 2024-07-02
3+
---
4+
5+
# Numeric separators
6+
7+
Today I learned about [numeric separators](https://v8.dev/features/numeric-separators) in javascript.
8+
They are a small bit of syntactic sugar to make large numeric literals easier to read by letting you insert underscores anywhere in the number.
9+
10+
For example, if you need to specify 10mb in byes, instead of `10485760`, you can write it as:
11+
12+
```js
13+
const maxUploadSize = 10_485_760;
14+
```
15+
16+
They were added in ECMAScript 2021 and in C# 7.

0 commit comments

Comments
 (0)