if-else in JavaScript

Published on 16 Nov, 2020

if...else in JavaScript helps us to make decisions.

if (age > 60) {
  console.log("Senior");
} else {
  console.log("Not Senior");
}