commit
ac5fd8cd6b
1 changed files with 2 additions and 2 deletions
|
@ -324,7 +324,7 @@ Please note that an empty or a space-only string is treated as `0` in all numeri
|
||||||
|
|
||||||
```smart header="Compare with `Object.is`"
|
```smart header="Compare with `Object.is`"
|
||||||
|
|
||||||
There is a special built-in method [Object.is](mdn:js/Object/is) that compares values like `===`, but is more reliable for two edge cases:
|
There is a special built-in method [`Object.is`](mdn:js/Object/is) that compares values like `===`, but is more reliable for two edge cases:
|
||||||
|
|
||||||
1. It works with `NaN`: `Object.is(NaN, NaN) === true`, that's a good thing.
|
1. It works with `NaN`: `Object.is(NaN, NaN) === true`, that's a good thing.
|
||||||
2. Values `0` and `-0` are different: `Object.is(0, -0) === false`, technically that's true, because internally the number has a sign bit that may be different even if all other bits are zeroes.
|
2. Values `0` and `-0` are different: `Object.is(0, -0) === false`, technically that's true, because internally the number has a sign bit that may be different even if all other bits are zeroes.
|
||||||
|
@ -417,7 +417,7 @@ To write numbers with many zeroes:
|
||||||
|
|
||||||
For different numeral systems:
|
For different numeral systems:
|
||||||
|
|
||||||
- Can write numbers directly in hex (`0x`), octal (`0o`) and binary (`0b`) systems
|
- Can write numbers directly in hex (`0x`), octal (`0o`) and binary (`0b`) systems.
|
||||||
- `parseInt(str, base)` parses the string `str` into an integer in numeral system with given `base`, `2 ≤ base ≤ 36`.
|
- `parseInt(str, base)` parses the string `str` into an integer in numeral system with given `base`, `2 ≤ base ≤ 36`.
|
||||||
- `num.toString(base)` converts a number to a string in the numeral system with the given `base`.
|
- `num.toString(base)` converts a number to a string in the numeral system with the given `base`.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue