x | y | x && y | x || y |
---|---|---|---|
false | false | false | false |
true | false | false | true |
false | true | false | true |
true | true | true | true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let i = 0; | |
do { | |
alert(i); | |
i++; | |
} while(i < 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let i = 0; | |
while(i < 3){ | |
alert(i); | |
i++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const a = null || 2; | |
const b = null && 2; | |
alert(a); | |
alert(b); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const a = true; | |
const b = false; | |
if(a && b){ | |
alert("a && b === true"); | |
} | |
if(a || b){ | |
alert("a || b === true"); | |
} |
x | !x |
---|---|
true | false |
false | true |
Օպերատրո | Անվանում | Նկարագրություն |
---|---|---|
&& | կոնյունկցիա | տրամաբանական «եւ» |
|| | դիզյունկցիա | տրամաբանական «կամ» |
! | ժխտում | տրամաբանական «ոչ» |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var age = 23; | |
if (age < 12) { | |
alert("You are toddler!"); | |
} else if (age < 18) { | |
alert("You are teen!"); | |
} else { | |
alert("You are adult!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var age = 23; | |
if (age < 12) { | |
alert("You are toddler!"); | |
} else { | |
if(age < 18) { | |
alert("You are teen!"); | |
} else { | |
alert("You are adult!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const condition = false; | |
if (condition) { | |
alert("Condition is true"); | |
} else { | |
alert("Condition is false"); | |
} |