File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
1-js/02-first-steps/11-logical-operators/2-alert-or Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1- The answer: first ` 1 ` , then ` 2 ` .
1+ Atsakymas yra: pirma ` 1 ` , tada ` 2 ` .
22
33``` js run
44alert ( alert (1 ) || 2 || alert (3 ) );
55```
66
7- The call to ` alert ` does not return a value. Or, in other words, it returns ` undefined ` .
7+ Šaukimas ` alert ` negrąžina jokios vertės. Arba kitaip sakant, jis grąžina ` undefined ` .
88
9- 1 . The first OR ` || ` evaluates it's left operand ` alert(1) ` . That shows the first message with ` 1 ` .
10- 2 . The ` alert ` returns ` undefined ` , so OR goes on to the second operand searching for a truthy value .
11- 3 . The second operand ` 2 ` is truthy, so the execution is halted, ` 2 ` is returned and then shown by the outer alert.
9+ 1 . Pirmasis ARBA ` || ` įvertina kairėje esantį operandą ` alert(1) ` . Jis parodo žinutę su ` 1 ` .
10+ 2 . ` alert ` grąžina ` undefined ` , tad ARBA eina prie sekančio operando ieškodamas truthy vertės .
11+ 3 . Antrasis operandas ` 2 ` yra truthy, tad operacija sustabdoma, grąžinamas ` 2 ` ir parodomas per išorinį alert.
1212
13- There will be no ` 3 ` , because the evaluation does not reach ` alert(3) ` .
13+ Nebebus ` 3 ` , nes įvertinimas nepasiekia ` alert(3) ` .
You can’t perform that action at this time.
0 commit comments