[Instructor} In this lesson, we're going to talk about why we might want to consider using JavaScript's new class syntax. So just to start out, let's be clear. It's not as if you couldn't do object-oriented style programming in JavaScript before, it's just that there wasn't specifically something called the class, that you could create. But you could create this container for properties, behaviors, of something you wanted to group together as an object. And this is the way we did it. So we created a function, and we send some parameters in. This serves the purpose of the constructor of the object. And I just assign those input parameters to things that I create as properties. This dot makes that a property of what will eventually be this object that we create. Where the syntax gets a little murkier, in the old school style, is that to add method definitions into this object, we would add those on to the prototype of this original function. Not that it didn't work, it did work and it still does, but if you're someone who's relatively new to using this, it might look a little clunky, a little weird. So for this sample object I've got these four methods that I created and added. Also, you could do inheritance, but again, maybe it's not quite as familiar of a syntax, as you would have, if you've worked with other object oriented languages. If that was a vacation request, this is a special request, and this calls that constructor from the other object, makes all my other prototype methods available. And there I go. Like I said, this works, it still does work. But with the newer versions of JavaScript with ECMAScript 2015, we have an actual class keyword in JavaScript. And now we can create a constructor. And what makes it a constructor, is that it actually uses the word constructor. Now, unlike other languages, you can only have one constructor. JavaScript still doesn't do overloading like other languages do. But you can see here the process, where we assign properties is basically the same. And if I look at these other methods, we could look back at that other code, and see the code inside of these, is no different than in the other cases, but it makes a heck of a lot more sense, because now, and you can see when I collapse it, all of this code is inside this class definition. It's inside these braces. It's visually apparent, that it's all part of this class. Inheritance also changes. Now I can use the class keyword and extends and use the name of the base class. And from my constructor method here, super is what I use to call the constructor of the class that this extends. That again being best practices way, you set up a class framework structure. And I can also add my other properties to this object as needed. So if you're creating objects, the preferred way to go now, would be to use the class syntax. It is mostly syntactical sugar, in that it makes this job easier. If you go and look at the internals, you'll see a class is really just a special function. There are some differences though. Function definitions are hoisted, class definitions aren't, so hoisting remember is just that function decorations are put into memory, before any code is run. So you can potentially use the function before you declare it. I myself prefer the class for that reason. It makes my code easier to read. The body of the class also runs in strict mode, so you're guaranteed that code optimization there, as well. Thanks for watching, in the next lesson, we'll look at what the common structure of a class definition is.