or sign in js code example
Example 1: or operator in javascript
var a = true;
var b = false;
if(a || b) {
}
Example 2: or operator javascript
var a = 2;
var b = 5;
var c = 10;
if (a === 3 || a === 2) {
console.log("TRUE");
} else {console.log("FALSE");}
if (a === 4 || b === 3 || c === 11) {
console.log("TRUE");
} else {console.log("FALSE");}
if (b === 5 || c != 10) {
console.log("TRUE");
} else {console.log("FALSE");}
Example 3: and operator in javascript
console.log(5 & 13);
Example 4: what does -= mean in JavaScript
var myVar = 5;
console.log(myVar)
var myVar = myVar - 3;
console.log(myVar)
var myVar = 5;
console.log(myVar)
var myVar -= 3;
console.log(myVar)