Web Core Lesson 1 of 8

if and else in JavaScript

30 min, 5 exercisesCode

JavaScript counts 0 and an empty string as equal, and sooner or later an if statement trips over it.

You've reached the good stuff.

5 exercises, checked as you type.

  • All 4 courses
  • Projects
  • Bug hunts
  • No ads

See what’s included

Sign in

JavaScript