diff --git a/content/questions/old-enough-to-drink/index.md b/content/questions/old-enough-to-drink/index.md new file mode 100644 index 00000000..6424a707 --- /dev/null +++ b/content/questions/old-enough-to-drink/index.md @@ -0,0 +1,38 @@ +--- +title: Old Enough to Drink +tags: + - conditional +order: 76 +date: '2021-04-10' +answers: + - 'Sorry, you\'re too young.' + + - 'Hey, you may enter the bar // correct' + + - 'error' +--- + + Friday Night Drinks! Create a variable that holds a person's age. If their age is greater than 21, return "Hey, you may enter the bar"; otherwise return "Sorry, you're too young." + + +```javascript + +const age = 21; + +function oldEnough() { + + if (age > 21) { + return "Hey, you may enter the bar"; + } else { + return "Sorry, you're too young."; + } +}; + +console.log(oldEnough()); +``` + + + +Here's a simple conditional to set a variable that will determine whether or not a person is old enough to have an adult beverage! + + diff --git a/scripts/new-question/index.md b/scripts/new-question/index.md index 5292450c..f066ed87 100644 --- a/scripts/new-question/index.md +++ b/scripts/new-question/index.md @@ -10,5 +10,4 @@ answers: - - + \ No newline at end of file