Skip to content

Instantly share code, notes, and snippets.

@ldco2016
Created July 3, 2018 00:10
Show Gist options
  • Select an option

  • Save ldco2016/e68a250abc801881a570a86a4d52353e to your computer and use it in GitHub Desktop.

Select an option

Save ldco2016/e68a250abc801881a570a86a4d52353e to your computer and use it in GitHub Desktop.
Control Flow
let isNightTime = true;
if (isNightTime) {
console.log('Turn on the lights!');
} else {
console.log('Turn off the lights!');
}
@ldco2016
Copy link
Author

ldco2016 commented Jul 3, 2018

age >= 16 ? console.log('You are old enough to drive in the United States!') : console.log('You are not old enough to drive in the United States!');

@ldco2016
Copy link
Author

ldco2016 commented Jul 3, 2018

let isLocked = false;

if (isLocked) {
  console.log('You will need a key to open the door.');
} else {
  console.log('You will not need a key to open the door.');
}

let isCorrect = true;

if (isCorrect) {
  console.log('Correct!');
} else {
  console.log('Incorrect!');
}

let favoritePhrase = 'Love That!';

if (favoritePhrase === 'Love That!') {
  console.log('I love that!');
} else {
  console.log("I don't love that!");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment