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
No active XP Potion
Accept a Quest
Login to submit answers
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".
Focus Editor
Alt+Shift+]
Login to Submit
Login to Run
Login to view solution