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

I don't is program mai ya galti ho rhi hai

i m stuck in 3 day at same level , i don't kya galti kr rhi hu .
let signal ;
// write logic here
// Assume signal variable holds the current signal state

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

3 Answers

kshitijrana14
Hii, please mention level id and lesson id
kshitijrana14
if you are in level 4 and lesson 4:
Try this one if you are in the above-mentioned level and lesson:

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");
}
Vikas4801
Hello, Use the below code I hope it will work.



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.