Javascript-objects-Q&A Flashcards
What are objects used for?
Object properties can be both primitive values, other objects, and functions. An object method is an object property containing a function definition. JavaScript objects are containers for named values, called properties and methods.
What are object properties?
Object properties are defined as a simple association between name and value. All properties have a name and value is one of the attributes linked with the property, which defines the access granted to the property. Properties refer to the collection of values which are associated with the JavaScript object.
Describe object literal notation.
The Object literal notation is basically an array of key:value pairs, with a colon separating the keys and values, and a comma after every key:value pair, except for the last, just like a regular array. Values created with anonymous functions are methods of your object.
How do you remove a property from an object?
The delete operator deletes both the value of the property and the property itself.
What are the two ways to get or update the value of a property?
You do this using the dot notation and square brackets