and or logic 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: || in js
const a = 3;
const b = -2;
console.log(a > 0 || b > 0);
// expected output: true