- Lets's take what we've learned about JS objects and put it to work!
- create yourself as an object
- However, build your parents first!
- First build two objects
mom
anddad
as object literals (e.g.var mom = {}
). If you have a non-traditional family structure, just use someone everybody loves, like Joe Biden or Oprah. - Create one Physicality object and one Personality object for each parent (e.g.
mom.physicality = {}
andmom.personality = {}
). - Using different data types (Number, String, Array, Object, Null, & Boolean), add 5 physical attributes to each of your parents.
- Do the same with the personality object!
- Now build yourself by referencing physical and personality attributes from your folks!
- Make 2 lists: first, what you're good at, and second, what you're bad at.
- Age yourself.
- Delete half of the things you were good at.
- Age yourself (again).
- Add
'sitting'
to the things you're good at and remove everything else from the list. - Add 5 more things to the list of things you're bad at.
BONUS: Create a method that prints out one of your classic sayings!
- If you finish the lab, try one of these exercises! There's no starter code for these, so you can start from scratch
Become Ash Ketchum
- You are now a pokemon trainer. Yes, your middle school dreams (elementary school, maybe? okay, high school.) are now fulfilled.
- Build Your starting six pokemon!
- Create each pokemon as an object literal.
- Give each pokemon at least eight properties - be sure to use each data type in the properties (think
health: 500
ormoves: ['ice punch', 'friend chip', 'mega sneeze']
). - Give each pokemon a reference to another pokemon, in case they faint!
- Create an array
myPokemon
and push or unshift each pokemon into the array in the order you choose. - BONUS: Give your pokemon a move as a method - make it remove an amount of HP from another pokemon foe!!
- Become the sweaty human behind the counter, make your menu, and start making some friggin' pizzas.
- Create a menu object.
- Create 5 pizzas, each referenced within the menu object as distinct properties (like
dailySpecial: {
fill this in on the next step}
). - Give each pizza 6 properties.
- Be sure to use each data type in the properties (think
calories: 5000
,meat: null
orpreferredBy: 'vegetarians'
). - BONUS: Create a method on the menu object that prints to the console the entirety of the menu!