-
-
Save codecademydev/2cc31c2b343a9586d36408db9653b67a to your computer and use it in GitHub Desktop.
Codecademy export
This file contains 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 userName = 'Lisa'; | |
userName ? console.log(`Hello, ${userName}!`) : console.log('Hello!'); | |
let userQuestion = 'Will I get married?' | |
console.log(`The user asked: ${userQuestion}`); | |
let randomNumber = Math.floor(Math.random() * 8); | |
let eightBall = ''; | |
if (eightBall === 0) { | |
console.log('It is certain'); | |
} else if (eightBall === 1) { | |
console.log('Totally doubt it'); | |
} else if (eightBall === 2) { | |
console.log('Maybe so'); | |
} else if (eightBall === 3) { | |
console.log('Not at all'); | |
} else if (eightBall === 4) { | |
console.log('My sources say no'); | |
} else if (eightBall === 5) { | |
console.log('Signs point to yes'); | |
} else if (eightBall === 6) { | |
console.log('Reply hazy try again'); | |
} else if (eightBall === 7) { | |
console.log('It is not sure'); | |
} else { | |
console.log(`The eight ball answered: ${eightBall}`); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment