LearnJS 3 Control Flow. 10 Ternary Operator



The code runs ok and produces the results it should BUT there are errors at the ends of each decision:
console.log("I don't love that!"); so ) is marked as an error. The exercise will not mark as correct. (1 does but not 2 or 3)

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 === 'Love That!'? 
  console.log('I love that!'):
  console.log("I don't love that!");


its double dots' not a semicolon :stuck_out_tongue:


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