curriculum/challenges/english/blocks/workshop-logic-checker-app/690a3ad44874a928a2fe3077.md
Comparison operators allow you to compare values and write more complex conditional statements.
if (today == birthday) {
console.log("Happy Birthday!");
}
For example, the code above logs "Happy Birthday!" to the console only when the values of the variables today and birthday are equal.
Create a third if statement. For its condition, use the >= operator to check if timmyAge is greater than or equal to 16.
Inside the body of your new if statement, log "Timmy is old enough to drive." to the console.
You should have a third if statement in your code.
assert.match(__helpers.removeJSComments(code), /const\s+timmyAge\s*\=\s*.+\bif\s*\(.+\)\s*\{.+\}/s);
Your third if statement should use timmyAge >= 16 as its condition.
assert.match(__helpers.removeJSComments(code), /const\s+timmyAge\s*\=\s*.+\bif\s*\(\s*timmyAge\s*>=\s*16\s*\)\s*\{.+\}/s);
You should log "Timmy is old enough to drive." to the console inside your third if statement.
assert.match(__helpers.removeJSComments(code), /const\s+timmyAge\s*\=\s*.+\bif\s*\(\s*timmyAge\s*>=\s*16\s*\)\s*\{\s*console\s*\.\s*log\s*\(\s*('|"|`)Timmy is old enough to drive.\1\s*\)\s*;?\s*\}/s);
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.");
}
const timmyAge = 18;
--fcc-editable-region--
--fcc-editable-region--