In this lesson we're going to explore JavaScript objects to best illustrate how objects work.
Let's think of a real life object a car for example a car has various properties like name model weight
and color we can include the values for each of these properties inside a single javascript object in
this example.
We've defined a variable named car the car variable is an object and contains several properties including
type model and color if we wanted to output the value of a single property inside this object.
We can use our get element by I.D. output method we can type car dot type to output the car type.
Let's go ahead and test this file in our web browser and see what the output results in
here.
We can see that the output is accurate.
Which correctly reflects the type of the car.
Now if we wanted to output the model we simply need to update from car type to car model
we can save or file and refresh the page and now we have the model output it in our web browser.