This course has been updated into a 4 part series! We now recommend you take the A Practical Guide to Algorithms with JavaScript course.

Check out a free preview of the full Data Structures and Algorithms in JavaScript course:
The "Using a Class" Lesson is part of the full, Data Structures and Algorithms in JavaScript course featured in this preview video. Here's what you'd learn in this lesson:

Before moving into the first exercise, Bianca shares a few examples of how classes are used in JavaScript. She also talks about what parts of pseudoclassical JavaScript are typically required knowledge in job interviews.

Get Unlimited Access Now

Transcript from the "Using a Class" Lesson

>> Bianca Gandolfo: All right, and here's just some examples of how this is executed, and you have your instances, so your house, you have the office, and then your house at countFloors is going to show, it's gonna say, I have two floors. theOffice.countFloors says I have 12 floors, cool? No surprises, we're good to go?

[00:00:26] All right.
>> Bianca Gandolfo: All right, so things to note, there are other ways to implement classes in JavaScript, this is sort of the industry standard. Then it's what's expected. There are lots of debates on them, which one's better, how to do it specifically, I'm not really gonna engage in that right now, It's not really important for what we're talking about.

[00:00:48] You can search on the internet different class patterns in JavaScript, and people have lots of angry opinions just like, it's like one of those tabs and spaces kind of things. They're super nitpicky about it, however for your interviews you're probably going to be expected to know the pseudo classical style, most likely.

[00:01:10] You might see elements of this in you favorite JavaScript framework. So even if you haven't done this and created classes yourself, you've probably been using them in different way, especially if you're using the key word, new, it's probably somewhere under the hood.
>> Bianca Gandolfo: Awesome.
>> Bianca Gandolfo: Cool, so one last thing.

[00:01:34] Subclassing and inheritance are not covered in this course. If you want more information you can follow this link to the blog. You can learn all about it. It's very interesting, also very important, but again, outside of the scope of this class.