JavaScript Objects Worksheet

Question 1

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

Objects (in the case of JavaScript) are made up of properties. These hold a value that can be called later for a specific object. They can be broken down to property name and property value or name/value pair.

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.

The different of notations that are used when working with properites are dot notation as well as bracket notation. dot notation is done by having the object.property while the bracket notation is done by object['Property']

Question 3

Why are objects an important data type in JavaScript?

Objects are a critical part of most programming languages and for JavaScript it is no expection. Most actions taken inside of Javascript can been seen as objects or something based on objects.

Question 4

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

The colon is used to separate property from their values.

Question 5

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

Property names/ values pairs are separated by commas expect the last pair in an object.

Question 6

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

To access the properties of an object we would want to use the dot operator.The example that follows would be the dot operators with object being the object and properties being the properties of an object (obejct.properties).

Coding Problems

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