Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Updating a Property Solution1:09 with Ashley Boucher
Solution video for updating a property code challenge.
For the final challenge,
you were tasked with updating a property value of the MyString object.
The string property should be changed from Programming with Treehouse is fun
This is a lot like the previous challenge where you created a property on the fly
and assigned it a value.
To update a property, you access is using dot or bracket notation, and
then assign it a new value.
For this challenge, that looks like this.
Now let's output all of myString to the console and see what we get.
As you can see, the whole object is output.
And it chose the new value for the string property, the countWords method, and
the characters property that we added on the fly.
Great work on this practice session.
I hope you enjoyed it.
Talk to you soon, and keep on coding.
You need to sign up for Treehouse in order to download course files.Sign up