INTRODUCTION
A CLASS
A class is a blueprint for creating Object. A class encapsulate data and funstions that manipulate data. Javascript classes are syntactic sugar over the the prototypal inheritance ,in order word ES6 special functions.
HOW TO CREATE A CLASS
To create a class you use the class keyword. Within the class, we create a constructor function, which define all the initial properties.
A class is a template for creating objects. All the properties in the constructor function will be automatically added to the new object.
###CONCLUSION
Javascript class represent a major step forward in javascript object oreinted programming, javascript classes provide a much simpler and clearer syntax for creating objects and dealing with inheritance and also solve some problems that comes with using prototypes
Top comments (1)
Ponele ganas