Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added question to repository by @5usana #191

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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 -->