Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions content/questions/old-enough-to-drink/index.md
Original file line number Diff line number Diff line change
@@ -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());
```

<!-- explanation -->

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!


3 changes: 1 addition & 2 deletions scripts/new-question/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ answers:



<!-- explanation -->

<!-- explanation -->