Classes

With ES6, class was used to create objects. Do note though, this is just syntax, not actual classes you would see in other languages.

An important function to mention is a constructor - a function that creates new objects and defines their properties and behaviors.

class Movie {
    constructor(type) {
        this.type = type;
    }
}

const comedy = new Movie("comedy");
console.log(comedy.type); // will display "comedy"

Classes provide a cleaner way to create objects and define blueprints for object-oriented programming in JavaScript.