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
Using object literals isn't always feasible. In this video, you'll get a taste of classes: a more robust option for working with objects.
This video doesn't have any notes.
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
Now that you've mastered object literals
we're going to tackle another way to
0:00
create and work with objects
in JavaScript, called classes.
0:03
Let's dive right in.
0:06
Object literals are a handy way to
encapsulate data about something specific,
0:08
like my dog Ernie.
0:12
But they aren't great when you want to
represent multiples of something with
0:14
the same or
similar properties and methods.
0:18
See, I actually have three
other pets aside from Ernie.
0:20
I've coded up some object literals for
each of them as well.
0:24
Take a look in the pets.js
file to see them.
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