Complete the if Statement
Fill in the Blank Beginner
Question
Fill in the blank so the message prints when age is 18 or older.
Code
let age = 18;
if (age ___ 18) {
console.log("You can vote!");
}
Hint
We need 'greater than or equal to'.
Explanation
The >= operator means 'greater than or equal to'. Since age is 18, age >= 18 is true, so the message prints. Using > alone would be false for exactly 18, and = would be assignment, not comparison.
Related Resources
Related Lessons
- Conditions (if/else)
Learn how if/else conditions work.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.