You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the differences between objects and arrays.
With your neighbor, discuss the differences between objects and arrays.
Create objects using the object literal syntax.
Create an object literal that contains the following keys, and appropriate values:
- firstName
- lastName
- age
Store the object in a variable name person.
Access and add values in an object using both bracket and dot notation. Describe the difference between them.
Add the following keys to the object created in the previous CFU
- favoriteCity
- favoriteIceCreamFlavor
Use both, bracket and dot notation to print out favoriteCity and favoriteIceCreamFlavor
With your neighbor, discuss the diferences between bracket and dot notation.
Strech goal:
Use a Object.keys() and a for loop to print out all of the key-value pairs
Combine objects and arrays to create arrays of objects and objects with array values.
Create an object that contains the following keys, with appropriate values:
- favoriteIceCreams
- favoriteCities
In each key, store an array with appropriate values.
Combine targeting methods to target specific values in objects which are in an array.
Given the following array:
var superheroes = [
{
heroName: 'Superman',
civilianName: 'Clark Kent'
},
{
heroName: 'Batman',
civilianName: 'Bruce Wayne'
},
{
heroName: 'Green Lantern',
civilianName: 'Hal Jordan'
}
]
console.log() Batman's civilian name