Welcome! This the homework to accompany the Girl Develop It JavaScript 101 class. You can always reference the slides if you get stuck. Commit to spend at least 20 minutes trying to figure out a problem before you look at the answers. It helps you learn!

1. The Fortune Teller

Why pay a fortune teller when you can just program your fortune yourself?

2. The Calculator

3. What number is bigger?

Write a function that compares two numbers and returns the larger one. Be sure to try it our with some different numbers. Bonus: add error messages if the numbers are equal or cannot be compared.

Don't forget to test it!

4. Pluralize

Write a function pluralize that takes in two arguments, a number and a word, and returns the plural. For example:

pluralize(5, 'cat'): '5 cats'
pluralize(7, 'turtle'): '7 cats'
			

Bonus: Make it handle a few irregular plural nouns like "deer" and "geese".

5. Even/Odd Counter

Write a for loop that will iterate from 0 to 20. For each iteration, it will check if the current number is even or odd, and report that to the screen (e.g. "2 is even")

6. Top Choice

Create an array to hold your top choices (colors, presidents, whatever). For each choice, log to the screen a string like: "My #1 choice is blue." Bonus: Change it to log "My 1st choice, "My 2nd choice", "My 3rd choice", picking the right suffix for the number based on what it is.

Challenge Question!: MixUp

Create a function called mixUp. It should take in two strings, and return the concatenation of the two strings (separated by a space) slicing out and swapping the first 2 characters of each. You can assume that the strings are at least 2 characters long. For example:

mixUp('mix', pod'): 'pox mid'
mixUp('dog', 'dinner'): 'dig donner'
			

Hint: You'll need to use some of the built-in JavaScript methods for strings. Methods are pre-written functions that are built into the language.