Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 8 and lesson 1

function teaBreak() {
console.log("Start making tea");
console.log("Tea ready");
console.log("Enjoy the tea");
console.log("-------");
}

for (let teaHour = 1; teaHour <= 12; teaHour++) {
if (teaHour % 4 === 0) {
teaBreak();
}
}

output is right as per question

but this show error like this -
Do we need an if condition somewhere? Yes, along with correct condition.
by

3 Answers

katty00
Your code logic for taking a tea break every 4 hours looks correct, but the error message suggests there's an issue with the if condition. Ensure your if statement if (teaHour % 4 === 0) is correctly implemented to call teaBreak() every 4 hours. Sometimes errors can stem from minor formatting issues or overlooked problem requirements. Double-check the instructions to ensure nothing is missed, and if the issue persists, consider posting the exact problem statement for more specific help.
Sheebanzs95
I dont know the answer please can u provide me the answer
USMANflka8
please how did you solve the problem

Login / Signup to Answer the Question.