Skip to content

Commit d16fcca

Browse files
committed
minor fixes
1 parent 0326e1b commit d16fcca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

article.md

Lines changed: 2 additions & 1 deletion
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)