File tree Expand file tree Collapse file tree 3 files changed +102
-103
lines changed
1-js/02-first-steps/08-comparison Expand file tree Collapse file tree 3 files changed +102
-103
lines changed Original file line number Diff line number Diff line change 2
2
3
3
``` js no-beautify
4
4
5 > 4 → true
5
- " apple " > " pineapple " → false
5
+ " ананас " > " яблуко " → false
6
6
" 2" > " 12" → true
7
7
undefined == null → true
8
8
undefined === null → false
9
9
null == " \n 0\n " → false
10
10
null === + " \n 0\n " → false
11
11
```
12
12
13
- Some of the reasons :
13
+ Ось чому такі результати :
14
14
15
- 1 . Obviously, true.
16
- 2 . Dictionary comparison, hence false.
17
- 3 . Again, dictionary comparison, first char of ` "2" ` is greater than the first char of ` "1" ` .
18
- 4 . Values ` null ` and ` undefined ` equal each other only .
19
- 5 . Strict equality is strict. Different types from both sides lead to false.
20
- 6 . See (4).
21
- 7 . Strict equality of different types .
15
+ 1 . Очевидно, 5 більше за 4. true.
16
+ 2 . Посимвольне порівняння, тому ` false ` .
17
+ 3 . Знову посимвольне порівняння. Перший символ рядка ` "2" ` більший за перший символ другого рядка — ` "1" ` .
18
+ 4 . Спеціальний випадок. Значення ` null ` і ` undefined ` рівні під час не строгого порівняння .
19
+ 5 . Строге порівняння різних типів, тому ` false ` .
20
+ 6 . Дивіться (4).
21
+ 7 . Строге порівняння різних типів .
Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ importance: 5
2
2
3
3
---
4
4
5
- # Comparisons
5
+ # Оператори порівняння
6
6
7
- What will be the result for these expressions ?
7
+ Який буде результат порівняння цих виразів ?
8
8
9
9
``` js no-beautify
10
10
5 > 4
11
- " apple " > " pineapple "
11
+ " ананас " > " яблуко "
12
12
" 2" > " 12"
13
13
undefined == null
14
14
undefined === null
You can’t perform that action at this time.
0 commit comments