Skip to content

Instantly share code, notes, and snippets.

View tigransimonyan's full-sized avatar
🎧

տիգրան tigransimonyan

🎧
  • Armenia, Yerevan
View GitHub Profile
let i = 0;
do {
alert(i);
i++;
} while(i < 3)
let i = 0;
while(i < 3){
alert(i);
i++;
}
const a = null || 2;
const b = null && 2;
alert(a);
alert(b);
const a = true;
const b = false;
if(a && b){
alert("a && b === true");
}
if(a || b){
alert("a || b === true");
}
x y x && y x || y
false false false false
true false false true
false true false true
true true true true
x !x
true false
false true
var age = 23;
if (age < 12) {
alert("You are toddler!");
} else if (age < 18) {
alert("You are teen!");
} else {
alert("You are adult!");
}
var age = 23;
if (age < 12) {
alert("You are toddler!");
} else {
if(age < 18) {
alert("You are teen!");
} else {
alert("You are adult!");
}
const condition = false;
if (condition) {
alert("Condition is true");
} else {
alert("Condition is false");
}