Tell us what’s happening:
I do not understand what I am doing wrong. My code should run correctly.
This is what they are asking:
Step 12
A conditional statement can have an else clause, which runs code when the if condition is falsy. Here’s an example of an if...elsestatement:
Example Code
if (condition) {
console.log("condition is truthy");
} else {
console.log("condition is falsy");
}
Add an else clause to the existing if statement. Inside the body of your else clause, log "Timmy is not old enough to drive." to the console.
Your code so far
const hasDeveloperJob = true;
if (hasDeveloperJob) {
console.log("Timmy is employed as a developer.");
}
const isTimmyAGamer = false;
if (isTimmyAGamer) {
console.log("Timmy loves to play World of Warcraft.");
}
// User Editable Region
const timmyAge = 18;
if (timmyAge >= 16) {
console.log("Timmy is old enough to drive.");
}else {
console.log("Timmy is not old enough to drive.");
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Safari/605.1.15
Challenge Information:
Build a Logic Checker App - Step 12