Conditionals and Logic
Logical And Or
Combine boolean checks with && and ||.
Logical And Or
logical_and_or.js
const age = 20;
const hasPass = true;
const canEnter = age >= 18 && hasPass;
const discount = age < 18 || age >= 65;
console.log("age=" + age);
console.log("canEnter=" + canEnter);
console.log("discount=" + discount);
logical-and-or
`&&` requires both sides to be true. `||` allows either side to be true.