Replit
Run your first JavaScript snippets in a browser workspace.
Free and paid plans; usage limits and feature availability vary.
Explore toolLesson 2 of 3 · 9 min
if / else lets code choose a path: if (score >= 50) { pass() } else { retry() }.
Comparison operators like ===, > and <= produce true or false to drive those decisions.
Write an if/else that prints "Adult" when age is 18 or more, otherwise "Minor".
Optional resources
No purchase or partner signup is required to complete this course or earn quiz points.
These are official product links, not active affiliate links. Learnly does not currently earn a commission from them.
Run your first JavaScript snippets in a browser workspace.
Free and paid plans; usage limits and feature availability vary.
Explore toolLook up JavaScript and DOM references while you practice.
Free documentation.
Explore tool