Logical Comparison
Combining comparisons.
Examples
AND Condition
Both conditions must be true.
let age = 20;
if (age > 18 && age < 30) {
console.log("Young Adult");
}OR Condition
Either condition must be true.
let day = "Sunday";
if (day === "Saturday" || day === "Sunday") {
console.log("Weekend!");
}Test Your Knowledge
JavaScript Quiz
No quiz available for this topic yet.