Understanding else and else if in Javascript


Provide alternate paths in conditional logic.

Source Code

let score = 75;
if (score > 80) {
  console.log("Great job!");
} else if (score > 60) {
  console.log("Good job!");
} else {
  console.log("Try again!");
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments