javascripting icon indicating copy to clipboard operation
javascripting copied to clipboard

Exercise 9 -If Statements

Open Brett-A-Clark opened this issue 4 years ago • 1 comments

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

Brett-A-Clark avatar Jun 18 '21 14:06 Brett-A-Clark

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

itzsaga avatar Jun 21 '21 14:06 itzsaga