Skip to content

Instantly share code, notes, and snippets.

@Shurlow
Last active February 12, 2020 04:32
Show Gist options
  • Select an option

  • Save Shurlow/28440b45525bfba54ddbf4087b687da8 to your computer and use it in GitHub Desktop.

Select an option

Save Shurlow/28440b45525bfba54ddbf4087b687da8 to your computer and use it in GitHub Desktop.
Data Structures Lesson Notes

Data Structures

Objectives

  • Explain the difference between objects and arrays
  • Create arrays with data
  • Identify methods on arrays:
    • Create
    • Read
    • Update
    • Delete
  • Create objects with data
  • Identify methods on objects:
    • Create
    • Read
    • Update
    • Delete

Guiding Questions

Arrays

  • Given the following array, how do you add 'music' to the end:

    var partySupplies = [ 'balloons', 'snacks']

    How would you change 'snacks' to 'beer' instead?

    Your answer...

  • How do you create, read, update, & delete indevidual items in an array? Fill in the following table with the correct values:

    Action Method
    Create
    Read
    Update
    Delete

Objects

  • Create a car object with the following properties:

    • wheels: 4
    • engine: 'diesel'
    • ac: false

    How would you update the ac property to be true? How would you add a new property called moonRoof to the car object?

    Your answer...

  • How do you create, read, update, & delete indevidual items in an object? Fill in the following table with the correct values:

    Action Method
    Create
    Read
    Update
    Delete
  • Represent each of the following statements as either an object or array:

    • My cat is cool. She has black fur and a mild temper.
    • My morning routine consists of showering, brushing my teeth, then I put on my pants.
    • In my wallet I have 3 dollar bills, 4 quarters and a penny.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment