not operator javascript code example
Example 1: js greater than or equal to
>= // greater than or equal
<= // less than or equal
> // greater than
< // less than
== // equals
=== // strictly equals
!= // not equals
!== // stricly not equals
Example 2: not operator js
let a = true;
let b = !a;
console.log(b); //output: false
Example 3: javascript
||// || means or
Example 4: javascript and
var hungry=true;
var slow=true;
var anxious=true;
//&& means and
if(hungry && slow && anxious){
var cause="weed";
}
Example 5: javascript if not
var isDay = false;
if (!isDay) { //Will execute if isDay is false
console.log("It's night");
}
Example 6: || in js
const a = 3;
const b = -2;
console.log(a > 0 || b > 0);
// expected output: true