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

In the code editor, we have provided the teaBreak() function and have added some lines of code in it too.

In the code editor, we have provided the teaBreak() function and have added some lines of code in it too.

The code is supposed to allow 3 tea breaks in the 12 hours daytime, which is implemented using the for loop. But the code has a few missing parts. You have to find those missing parts to make the code work.

We need the for loop to work correctly, and there has to be a condition with some mathematical operation to execute the teaBreak() function 3 times.
by

1 Answer

iamabhishek
Assuming you are talking about the Level 8 Lesson 1, here is the code:

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

let teaHour;

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

Login / Signup to Answer the Question.