

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Conditionals
incomplete
2: Comparison Operators
incomplete
3: Logical Operators
incomplete
4: Switch
incomplete
5: Ternary Operator
incomplete
6: When to Ternary
incomplete
7: Truthy and Falsy
incomplete
8: Nullish Coalescing
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
if statements in JavaScript use parentheses around the condition:
if (height > 4) {
console.log("You are tall enough!");
}
else if and else are supported as you might expect:
if (height > 6) {
console.log("You are super tall!");
} else if (height > 4) {
console.log("You are tall enough!");
} else {
console.log("You are not tall enough!");
}
We'll cover some more of these, but for now, here are some common comparison operators:
=== equal to!== not equal to< less than> greater than<= less than or equal to>= greater than or equal toFix the bug on line 12. If messageLen is less than or equal to maxMessageLen, the program should log "Message sent"; otherwise, it should log "Message not sent".