javascripting
javascripting copied to clipboard
Exercise 9 -If Statements
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.

@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");