1. The 'if' Statement

let age = 20;

if (age >= 18) {
  console.log("Adult");
}
                

The Gateway

An if statement checks if a condition is **true**. If it is, the code inside the curly braces { } runs. If it's false, the browser simply skips that block.

2. The 'else' Clause

let age = 15;

if (age >= 18) {
  console.log("Adult");
} else {
  console.log("Minor");
}
                

The Alternative

The else statement acts as a "fallback." It runs only when the if condition is **false**. This ensures that your program always has a response, regardless of the input.