>

Day 8

  • Take Home Review
  • Objects
  • Daily Challenge
  • Classes
  • Take Home Challenge
  • Questions?
  • Properties
    • "key: "value" pair
    • Property Keys
      • Unique. No spaces. Special characters allowed if surrounded by quotes
    • Property Values
      • Not unique. Can be: strings, numbers, booleans, arrays, methods (functions), etc)
      • Access values using dot notation
    • MDN Reference: Objects
  1. Create a new codepen
  2. Congrats, you got a new dog!
    • Create an object named "dog"
  3. Name and describe your dog
    • Add a property to your dog object called "name" and assign a name
    • Add two more properties to describe your dog. (ex: How many legs, fur color, etc)
  4. Let's teach it some tricks
    • Give your dog a property called "speak" and assign a function that will alert "woof!"
    • Add another method to teach your dog one more trick
  5. BONUS: Display your dog object values in HTML
  • Questions?
  • Create a new codepen:
    1. Let's say you're a car manufacturer and need to create many cars to build your inventory
    2. Create a class called "car"
    3. Add some properties like "make", "model", "year", "color", etc
    4. Use your car class to construct 4 (or more) different cars
    5. console log your code so you can see the results!
    6. BONUS: Display the details for each of your cars in your HTML