and operator in js code example
Example 1: javascript and operator
const x = 7;
const y = 4;
(x == 7 && y == 5);
(x == 3 && y == 4);
(x == 7 && y == 4);
if (condition == value && condition == otherValue) {
return something;
}
Example 2: or operator in javascript
var a = true;
var b = false;
if(a || b) {
}
Example 3: less than equal to in javascript
| <= | less than or equal to | x <= 8 | true |
Example 4: and operator in javascript
var a = true
var b = ""
var c = 1
true && ""
"" && 1
false && 5
Example 5: js comparison operators
Javascript Comparison Operators
== Equal to
=== Equal value and equal type
!= Not equal
!== Not equal value or not equal type
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
? Ternary operator
Example 6: and operator in javascript
console.log(5 & 13);