workshopper / javascripting

Learn JavaScript by adventuring around in the terminal.
http://nodeschool.io
MIT License
2.86k stars 1.05k forks source link

Exercise 9 -If Statements #318

Open Brett-A-Clark opened 3 years ago

Brett-A-Clark commented 3 years ago

Below is my code

let fruit = 6 if(fruit > 5) { console.log("The fruit name has more than five characters"); } else { console.log("The fruit name has five characters or less"); }

Screenshot is error message. Please help. 01B0186A-ACA1-470A-A5B4-63E674943D67

itzsaga commented 3 years ago

@Brett-A-Clark if this is your exact code:

let fruit = 6
if(fruit > 5) {
console.log("The fruit name has more than five
characters");
} else {
console.log("The fruit name has five characters or less");
}

The root of the error is that this statement can't be on two lines:

console.log("The fruit name has more than five
characters");

Try:

console.log("The fruit name has more than five characters");