JS Built-ins
ControlFlowbeginner

Control Flow β€” if / else if / else

if-else chains

Use if, else if, and else to branch based on conditions.

Challenge: Write grade(score) that returns:

  • 'A' for score β‰₯ 90
  • 'B' for score β‰₯ 80
  • 'C' for score β‰₯ 70
  • 'D' for score β‰₯ 60
  • 'F' otherwise
πŸ’‘ Hints (1)
  • β€’ Check from highest to lowest β€” the first matching condition wins