if true statement javascript code example
Example 1: javascript if or
let A = 1;
let B = 0;
if (A == 1 || B == 1){
// some code here
}
Example 2: single if statement js true false
condition ? exprIfTrue : exprIfFalse
let A = 1;
let B = 0;
if (A == 1 || B == 1){
// some code here
}
condition ? exprIfTrue : exprIfFalse