Advertisement
makispaiktis

Codecademy - 10th Course (Ternary Operator)

Sep 29th, 2019 (edited)
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let isLocked = false;
  2. isLocked ? console.log('You will need a key to open the door.') : console.log('You will not need a key to open the door.');
  3.  
  4. let isCorrect = true;
  5. isCorrect ? console.log('Correct!') : console.log('Incorrect!');
  6.  
  7. let favoritePhrase = 'Love That!';
  8. favoritePhrase === 'Love That!' ? console.log('I love that!') : console.log("I don't love that!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement