Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed JavaScript Objects!
You have completed JavaScript Objects!
Preview
Use dot notation to set the value of an object's property and add new properties to an object.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You use the equal sign, or the assignment
operator, just as you do with variables.
0:00
For example, to change the name
property of this student object,
0:00
you assign it a new value like this.
0:04
In fact, you can even create and
add new properties to an object this way.
0:06
For example, to add a city property to
the student object, you'd write this.
0:10
This not only adds a property
named city to the object, but
0:15
also assigns it a value.
0:19
Back in the object.js file,
0:21
let's change the value of
the person object's name property.
0:23
In the message, I'll include most
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up