JavaScript Objects Worksheet
Question 1
What makes up an object (what does an object consist of)?
An object is made of properties and values. The name of a property is assigned a value.
The value can be any data type.
Question 2
What are two different types of notations that you can use when working with the properites of objects? For example, there are two types of syntax that you could use if you wanted to update a property of an object.
You can use dot notation or bracket notation. Example: myDog.name = "Snoopy"; or myDog["name"] = "Snoopy";
Question 3
Why are objects an important data type in JavaScript?
Objets are important because you are able to group related data into one variable like parts of a car.
Question 4
When creating an object, what character is used to separate property names from their values?
You would use the colon (:).
Question 5
When creating an object, what character is used to separate the property/value pairs in an object?
You would use a comma (,).
Question 6
What operator is used to access a property of an object?
You could use the dot (.) or the bracket ([]).