Skip to content

Instantly share code, notes, and snippets.

@dinarname
Created March 23, 2019 09:07
Show Gist options
  • Save dinarname/69b84c7ab52f894b7169d27b5118de35 to your computer and use it in GitHub Desktop.
Save dinarname/69b84c7ab52f894b7169d27b5118de35 to your computer and use it in GitHub Desktop.
const yes = () => {
if (userAnswer === 'yes') {
console.log('Correct!');
} else {
console.log(`' ${userAnswer} ' is wrong answer ;(. Correct answer was ' yes '.`);
console.log(`Let's try again, ${name}!`);
break;
}
};
const no = () => {
if (userAnswer === 'no') {
console.log('Correct!');
} else {
console.log(`' ${userAnswer} ' is wrong answer ;(. Correct answer was ' no '.`);
console.log(`Let's try again, ${name}!`);
break;
}
};
isEven(number) ? yes : no;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment