or and and operator javascript code example
Example 1: or operator javascript
//|| is the or operator in JavaScript
if(a == 1 || b != 'value'){
yourFunction();
}
Example 2: and operator in javascript
//&& returns true if both values are true
//or returns the second argument if the first is true
var a = true
var b = ""
var c = 1
true && "" //""
"" && 1 //""
false && 5 //false