Skip to content

Commit 22888ae

Browse files
committed
minor fixes
1 parent e1c9b21 commit 22888ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

1-js/99-js-misc/05-bigint/article.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ alert(Number(bigint) + number); // 3
4848
The conversion of bigint to number is always silent, but if the bigint is too huge and won't fit the number type, then extra bits will be cut off, causing a precision loss.
4949

5050
````smart header="The unary plus is not supported on bigints"
51-
The unary plus operator `+value` is a well-known way to convert a `value` to number.
51+
The unary plus operator `+value` is a well-known way to convert `value` to a number.
5252
5353
On bigints it's not supported, to avoid confusion:
5454
```js run
5555
let bigint = 1n;
5656
5757
alert( +bigint ); // error
5858
```
59+
So we should use `Number()` to convert a bigint to a number.
5960
````
6061

6162
## Comparisons

0 commit comments

Comments
 (0)