There is some coding in this discussion. Feel free to write them in a REPL or in the comments below.
- How is an object different from an array?
- How does
constwork with objects? - Explain the difference between bracket syntax and dot syntax. Give an example of something that works with bracket syntax but not dot syntax. Give an example of something that works with dot syntax but not bracket syntax.
- What are computed properties? Write an example code.
- What is the difference between
Object.keysandObject.entries? Write example code using both of them. - How do we get only the values of an object?
Array is an ordered collection of data. Objects are unordered (though you can still look inside). Objects have key-value pairs and can hold more complex data (e.g., for a car, you can add more specific characteristics).
You can still change what is inside an object with const.
In one way, you can use quotation marks with all the characters or you can use variables to access properties.
For dot notation, you can only use dollar sign, underscore, letters, numbers, etc.
Object.keysreturns an array of keys.Object.entriesreturns an array of keys and values.