File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
1-js/02-first-steps/11-logical-operators/8-if-question Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,17 @@ La risposta: il primo e il terzo verranno eseguiti.
33I dettagli:
44
55``` js run
6- // Runs.
7- // The result of -1 || 0 = -1, truthy
6+ // Viene eseguito
7+ // Il risultato di -1 || 0 = -1 è vero
88if (- 1 || 0 ) alert ( ' first' );
99
10- // Doesn't run
11- // -1 && 0 = 0, falsy
10+ // Non viene eseguito
11+ // -1 && 0 = 0, falso
1212if (- 1 && 0 ) alert ( ' second' );
1313
14- // Executes
15- // Operator && has a higher precedence than ||
16- // so -1 && 1 executes first, giving us the chain :
14+ // Eseguito
15+ // L'operatore && ha la precedenza su ||,
16+ // quindi -1 && 1 vengono eseguiti per primi; la catena dentro `if` diventa :
1717// null || -1 && 1 -> null || 1 -> 1
1818if (null || - 1 && 1 ) alert ( ' third' );
1919```
You can’t perform that action at this time.
0 commit comments