Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created August 24, 2021 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/2cc31c2b343a9586d36408db9653b67a to your computer and use it in GitHub Desktop.
Save codecademydev/2cc31c2b343a9586d36408db9653b67a to your computer and use it in GitHub Desktop.
Codecademy export
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