how to use and in js code example
Example 1: javascript and
var hungry=true;
var slow=true;
var anxious=true;
//&& means and
if(hungry && slow && anxious){
var cause="weed";
}
Example 2: less than equal to in javascript
| <= | less than or equal to | x <= 8 | true |
Example 3: and javascript
let a = 1;
let b = -1;
if (a > 0 & b > 0){
console.log("and");
} else if (a > 0 || b > 0){
console.log("or");
}