Ternary Operators


let isLocked = false;

isLocked ? console.log('You will need a key to open the door.') : console.log('You will not need a key to open the door.');

let isCorrect = true;

isCorrect ? console.log('Correct!'): console.log('Incorrect!');

let favoritePhrase = 'Love That!';

favoritePhrase ? console.log('I love that!'):console.log("I don't love that!");

I cannot seem too see why the lesson will not let me pass. I believe my third code block is the the same as the first and second (Which were correct) but the third one keeps asking me “Did you change the third if/else statement to look like the examples above?” Which i have done. I have been staring at this code for hours and I might be missing something very simple, but can someone else give me advice or an explaination as to why it wont pass.?

Thank you in advance

Okay so i tried it in a different browser and it worked fine.

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