Add nullish coalescing to multiple articles, refactor operators, renumber the chapter
This commit is contained in:
parent
175aefa0b8
commit
8a13c992d6
54 changed files with 386 additions and 183 deletions
|
@ -0,0 +1,21 @@
|
|||
|
||||
|
||||
```js no-beautify
|
||||
5 > 4 → true
|
||||
"apple" > "pineapple" → false
|
||||
"2" > "12" → true
|
||||
undefined == null → true
|
||||
undefined === null → false
|
||||
null == "\n0\n" → false
|
||||
null === +"\n0\n" → false
|
||||
```
|
||||
|
||||
Some of the reasons:
|
||||
|
||||
1. Obviously, true.
|
||||
2. Dictionary comparison, hence false. `"a"` is smaller than `"p"`.
|
||||
3. Again, dictionary comparison, first char of `"2"` is greater than the first char of `"1"`.
|
||||
4. Values `null` and `undefined` equal each other only.
|
||||
5. Strict equality is strict. Different types from both sides lead to false.
|
||||
6. Similar to `(4)`, `null` only equals `undefined`.
|
||||
7. Strict equality of different types.
|
Loading…
Add table
Add a link
Reference in a new issue