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 Object-Oriented JavaScript!
You have completed Object-Oriented JavaScript!
Preview
Add methods to the class declaration.
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
If you'd like to keep following along,
open up the Pet.js file.
0:00
Hit Enter a few times after
the constructor method to put some white
0:03
space before the end of
the class declaration.
0:06
Each of our object literals
had a method called bark.
0:09
Our pet class should have
a similar method, some way for
0:12
the pet to express a sound.
0:15
But not all pets bark, hm.
0:17
What if we create a method for
our pet class called speak?
0:19
Let's start with that and
together we can work out the correct code.
0:23
On one of the new lines you created
type the name of the method, speak.
0:27
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