Guest User

Untitled

a guest
Jun 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. # Data Structures
  2.  
  3. ### Objectives
  4.  
  5. - [ ] Explain the difference between objects and arrays
  6. - [ ] Create arrays with data
  7. - [ ] Identify methods on arrays:
  8. - Create
  9. - Read
  10. - Update
  11. - Delete
  12. - [ ] Create objects with data
  13. - [ ] Identify methods on objects:
  14. - Create
  15. - Read
  16. - Update
  17. - Delete
  18.  
  19. ## Guiding Questions
  20.  
  21. ### Arrays
  22.  
  23. * Given the following array, how do you add `'music'` to the end:
  24. ```js
  25. var partySupplies = [ 'balloons', 'snacks']
  26. ```
  27. How would you change `'snacks'` to `'beer'` instead?
  28.  
  29. > Your answer...
  30.  
  31. * How do you create, read, update, & delete indevidual items in an **array**?
  32. Fill in the following table with the correct values:
  33.  
  34. | Action | Method |
  35. | ------ | ------ |
  36. | Create | |
  37. | Read | |
  38. | Update | |
  39. | Delete | |
  40.  
  41.  
  42. ### Objects
  43.  
  44. * Create a car object with the following properties:
  45. - wheels: `4`
  46. - engine: `'diesel'`
  47. - ac: `false`
  48.  
  49. How would you update the `ac` property to be `true`? How would you add a new property called `moonRoof` to the car object?
  50.  
  51. > Your answer...
  52.  
  53. * How do you create, read, update, & delete indevidual items in an **object**?
  54. Fill in the following table with the correct values:
  55.  
  56. | Action | Method |
  57. | ------ | ------ |
  58. | Create | |
  59. | Read | |
  60. | Update | |
  61. | Delete | |
  62.  
  63. * Represent each of the following statements as either an object or array:
  64. - My cat is cool. She has black fur and a mild temper.
  65. - My morning routine consists of showering, brushing my teeth, then I put on my pants.
  66. - In my wallet I have 3 dollar bills, 4 quarters and a penny.
Add Comment
Please, Sign In to add comment