Build a Bio
Codepen Instructions
Create a new CodePen pen.
Instructions
- Create a variable that stores your name.
- Create a variable that stores your age.
- Create a variable that stores your favorite food.
- Write a statement that says "My name is ___ and I'm ___ years old. My favorite food is ___." using your variables stored above. Console log this statement.
- Create a boolean variable that stores if you like to travel.
- Write a conditional statement that either console logs "I like to travel." or "I'm a homebody." based on your answer to the step above.
Output
My name is Callan and I'm 27 years old. My favorite food is pizza.
I'm a homebody.
The Real Skinny on My Work Experience
Codepen Instructions
Create a new CodePen pen.
Instructions
- Declare a variable (string) that stores your
currentJob.
- Write an if/else if/else conditional statement that is based on each job on your resume and console logs a different statement based on how you felt about that job. For example:
if (currentJob === 'junior instructor'), then console
log: 'My current job is junior instructor. I LOVE helping! But they don't give me enough free food.' else if (currentJob === 'tooth fairy helper'), then console log 'My current job is tooth fairy helper. I am really just in it
for the teeth.'
- For the 'else' statement, write something funny about that not being one of your previous jobs.
- Try changing your current job to another one of your past jobs. Watch how it console logs a different statement when you do.
Output
I've had 3 previous jobs: junior instructor, tooth fairy helper, marketing manager. This is an example of what I get each time I change the value of the variable currentJob.
When my current job variable is set to: 'junior instructor' => My current job is junior instructor. I LOVE helping! But they don't give me enough free food.
When my current job variable is set to: 'tooth fairy helper' => My current job is tooth fairy helper. I am really just in it for the teeth.
When my current job variable is set to: 'marketing manager' => My current job is marketing manager. I know way too much about Instagram and Twitter.
When my current job variable is set to: 'professional weight lifter' => I've never worked as a 'professional weight lifter'. Obviously I'm not qualified for that.
The Age Game
Codepen Instructions
Create a new CodePen pen.
Instructions
You'll be creating variables in JavaScript and using them to determine what age you'll be in some future year.
- Store your birth year in a variable.
- Store a future year in a variable.
- Calculate your 2 possible ages for that year based on the stored values. For example, if you were born in 1988, then in 2026 you'll be either 37 or 38, depending on what month it is in 2026.
- Console log them to the screen like so: "I will be either __ or __ in YYYY", substituting the values.
Bonus:
- Create a variable for your birth month.
- Create a variable for your the current month.
- Use a conditional statement to determine that if it is in or past that month, your age is the greater value.
- EG: If my birthday is in April 1990, and it is June 2020, I am 30 years old. If it is March 2020, I am 29 years old.