Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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:
- ```js
- 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.
Add Comment
Please, Sign In to add comment