File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
1-js/02-first-steps/11-logical-operators/8-if-question Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 1- The answer: the first and the third will execute .
1+ Жообу: биринчи жана үчүнчү аткарылат .
22
3- Details :
3+ Кененирээк :
44
55``` js run
6- // Runs .
7- // The result of -1 || 0 = -1, truthy
8- if (- 1 || 0 ) alert ( ' first ' );
6+ // Аткарылат .
7+ // Натыйжасы -1 || 0 = -1, чындык
8+ if (- 1 || 0 ) alert ( ' биринчи ' );
99
10- // Doesn't run
11- // -1 && 0 = 0, falsy
12- if (- 1 && 0 ) alert ( ' second ' );
10+ // Аткарылбайт
11+ // -1 && 0 = 0, жалган
12+ if (- 1 && 0 ) alert ( ' экинчи ' );
1313
14- // Executes
15- // Operator && has a higher precedence than ||
16- // so -1 && 1 executes first, giving us the chain :
14+ // Аткарылат
15+ // && оператору || операторунан жогору алгачкылыкка ээ
16+ // андыктан -1 && 1 алгач аткарылат, бизге ырааттуулукту берет :
1717// null || -1 && 1 -> null || 1 -> 1
18- if (null || - 1 && 1 ) alert ( ' third ' );
18+ if (null || - 1 && 1 ) alert ( ' үчүнчү ' );
1919```
2020
You can’t perform that action at this time.
0 commit comments