JavaScript Objects Worksheet

Question 1

What makes up an object (what does an object consist of)?

An object is a collection of properties and their values. Properties also known as 'Keys' are the names we use to the different pieces of data in an object and values is the data type associated with each key.

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.

When working with the properties of an object we have a choice of using the dot notation or the bracket notation.

Question 3

Why are objects an important data type in JavaScript?

Objects are inportant in any coding language because it allows us to create models of in our code that simulate real-world items. In the videos and reading we learn that objects can be seen as variables that store a bundle of information that represents what we would see in the the real-world.

Question 4

When creating an object, what character is used to separate property names from their values?

Names are separated from values with a colon ' : '.

Question 5

When creating an object, what character is used to separate the property/value pairs in an object?

We use commas ',' to separate property/value pairs in objects.

Question 6

What operator is used to access a property of an object?

We want to use the dot operator to access properties of an object.

Coding Problems

Coding Problems - See the 'script' tag below this h3 tag. You will have to write some JavaScript code in it.