Created
July 3, 2018 00:10
-
-
Save ldco2016/e68a250abc801881a570a86a4d52353e to your computer and use it in GitHub Desktop.
Control Flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let isNightTime = true; | |
| if (isNightTime) { | |
| console.log('Turn on the lights!'); | |
| } else { | |
| console.log('Turn off the lights!'); | |
| } |
Author
Author
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!');
Author
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
isNightTime ? console.log('Turn on the lights!') : console.log('Turn off the lights!');