Stuck on lesson 15


#1


https://www.codecademy.com/courses/getting-started-v2/2/4?curriculum_id=506324b3a7dffd00020bf661


if/else message don't look quite right


if (10<5 ) 
{
    console.log("Let's go down the first road!");
}
else (5<10) 
{
    // What should we do if the condition is false? Fill in here:
    
}

Replace this line with your code.


#2

Hi you should also put a console.log() inside the else block

// What should we do if the condition is false? Fill in here:

and remove the condition to teh else statement (5<10)

else (5<10)

#4

if/then/else statements are not written that way. The else statement doesn't take a condition since it's saying that if the if statement is not satisfied, then it will do the else. If you want to use an else if, that can take a condition.

if (1 < 0){
    console.log("This will not be printed.")
}
else if(2 < 1){
    console.log("This will not be printed either.")
}
else
{
    console.log("This will be printed because the other lines were not.")
}

#5

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