Created
March 23, 2019 09:07
-
-
Save dinarname/69b84c7ab52f894b7169d27b5118de35 to your computer and use it in GitHub Desktop.
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
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