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

Java Script Level 4 Lesson 5

/ I am facing problem with Java Script Level 4 Lesson 5
my code is as follows: */
let myvehicle = "bike";
let weather = "rainy";

if (weather == "rainy")
{
if (myvehicle == "car")
{
console.log("I go to the office");
}
else if (myvehicle == "bike")
{
console.log("I Work from home");
}

}
else if (weather == "rainy")
{
console.log("I go to the office");
}

*/-------------------------
Please Help
/
by

2 Answers

kshitijrana14
Try this one

let myvehicle = "car";
let weather = "rainy";

if(weather=="rainy")
{
if(myvehicle == "car")
{
console.log("I go to the office");
}
else if(myvehicle == "bike")
{
console.log("I Work from home");
}

}
else if(weather!="rainy")
{
console.log("I go to the office");
}
piyush321
Thank you, I'm beginning to understand how it works

Login / Signup to Answer the Question.