I tried to set the timmAge declaration to less than 16
<16
but it just won’t accept it .
Am I meant to put 16 before the less than sign
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 <16 = 18;
// User Editable Region
if (timmyAge >= 16) {
console.log("Timmy is old enough to drive.");
} else {
console.log("Timmy is not old enough to drive.");
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Finally, change the declaration of timmyAge and set it to a number less than 16
To declare a variable you assign it a value generally. This is the assignment operator =. Currently it’s assigned to the number 18 (which is greater than 16)
const timmyAge = 18;
< is a comparison operator. It’s used to check if a value is less than, and returns a boolean (True or False.) You use this in the next line if (timmyAge >= 16) {
Here’s your line of code const timmyAge = <16;
So what would the the value of timmyAge be here? What is it set to? It needs to be assigned a specific number.
because at 16 you can get a driving licence in the USA, at 15 you can’t, and you can’t at any age below either, so any number that is 15 or below (any number that is less than 16) works here
you are testing with any number that makes timmyAge >= 16 false