Unknown error on my challenge, help

Create an if statement that will evaluate if the weather is rainy and you’re feeling happy. If so, in the code block of the if statement, print the string “I am singing in the rain, just singing in the rain!”.
This is my challenge, i have created the following code:

var weather = 'rainy';
var isHappy = true;

if(weather === 'rainy'  && isHappy === true)
	console.log("I am singing in the rain,just singing in the rain!");
else
    console.log('');

but when i execute it, it says code incorrect unknown error, how can i solve this? thank you for your help

I think its a IDE created for a introdutory course on Java, but I am stuck on this particular challenge and it just always says the same thing when i execute it

i assumed “introdutory” said everything, thank you non the less for your help

Hey! Bro, you did not use { } brackets in if else statement.

i also give you a code with a proper way.

var weather = ‘rainy’;
var isHappy = true;

if(weather === ‘rainy’ && isHappy === true){
console.log(“I am singing in the rain,just singing in the rain!”);
}else{
console.log(‘’);
}


Nice to Meet You.

you know what, it was actually the brackets, thank you so much bro, something so simple, yet i tunneled so hard on the “unknown error” that i just didnt even second guess it

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.