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

In javascript course, Level 4, lesson 4.

I am unable to submit the code even my code is right.
if (signal === "green") {
console.log("Go");
} else if (signal === "yellow") {
console.log("Wait");
} else if (signal === "red") {
console.log("Stop");
} else {
console.log("Error");
}
by

1 Answer

iamabhishek
Here is the correct answer:

let signal = "yellow";
// write logic here
if(signal == 'green'){
console.log('Go');
} else if(signal == 'yellow'){
console.log('Wait');
} else if(signal == 'red'){
console.log('Stop');
} else{
console.log('Error');
}

Login / Signup to Answer the Question.