If else exercise helppppp

Hello,

I have been dealing with this exercise for 3 days nows. The exercise says that:
‘Take the if statement you created in the previous exercise and add an else statement. Inside the code block of the else statement, console.log() a string.’

What I am doing wrong??? Please helpppppppp

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('');}

You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. loops, learn-compatibility

1 Like

The output says:

Code is incorrect

Make sure you are printing the expected string

Could you link to the exercise so we can see what the expected output is?

Make sure your strings are exactly what the exercise asks you to log. Codecademy can be annoyingly meticulous – even a missing space in a string can throw an error… your else statement’s console.log arg might need to be ’ ’ instead of ‘’. or possibly even “” or " ". If they give you the exact string in the instructions for your else statement, i suggest copy/paste it directly into the editor. It is also possible that they want you to create your own custom error message: else{ console.log("conditions not met. "); }

also
i suggest formatting your code a little bit more nicely e.g every statement should be on a new line for better readability. (Of course this will not solve your problem but it will help you and others know what’s going on faster.)