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
const
work 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.keys
andObject.entries
? Write example code using both of them. - How do we get only the values of an object?
0- an object resembles many existing physical objects in life in terms it has properties and functions array was restricted to storing the same type but here in javascript it allows to the storage of different types.
1-it just make them un able to be modified.
2- Square bracket notation allows the use of characters that can't be used with dot notation. var foo = myForm.foo[]; // incorrect syntax
var foo = myForm["foo[]"]; // correct syntax.
3. Computed properties are labels that change based on the code
4. Object.keys shows you just the labels and Object.entries shows you the labels and the values
5. To only see the values, you can use Object.values method.