Decisions and loops
Lesson 11 of 20 · Web.Micro
`if` picks a path, loops repeat work: the two moves behind every program.
if (hour < 12) { ... } else { ... } chooses one of two blocks. Comparisons give booleans: <, >, <=, >=, === (equal) and !== (different). Change the hour and watch the message.
Check yourself
Which operator means "equal value and type"?
Do it in the browser: a real HTML, CSS and JavaScript tool, a short mission and instant feedback. No install.
Start this lesson — free