JavaScript does have classes. This feature was introduced with the ECMAScript 2015 specification (ES6).
However, itβs important to note that JavaScript is primarily a prototype-based language, and its classes are primarily syntactic sugar over the existing prototype-based inheritance mechanisms.
In other words, it provides a more familiar syntax for developers coming from the class-based language such as Java or C++, but underhood it works somewhat differently.
Object Literal