Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created January 12, 2021 19:18
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/6f5277aeb179982af9256a6c058c7c30 to your computer and use it in GitHub Desktop.
Save codecademydev/6f5277aeb179982af9256a6c058c7c30 to your computer and use it in GitHub Desktop.
Codecademy export
userName = 'Sam';
userName ? console.log(`Hello, ${userName}.`)
: console.log('Hello!');
let userQuestion = 'Will I make a lot of games?';
console.log(`The user asked: ${userQuestion}`);
let randomNumber = Math.floor(Math.random() * 8);
let eightBall = '';
switch (ranbomNumber){
case 0:
eightBall = 'It is certain';
break;
case 1:
eightBall = 'It is decidedly so';
break;
case 2:
eightBall = 'Reply hazy try again';
break;
case 3:
eightBall = 'Cannot predict now';
break;
case 4:
eightBall = 'Do not count on it';
break;
case 5:
eightBall = 'My sources say no';
break;
case 6:
eightBall = 'Outlook not so good';
break;
case 7:
eightBall = 'Signs point to yes';
break;
}
console.log(eightBall);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment