JAVASCRIPT CLIMBSChapter 5 · JS Functions and Classes
JS ES6 Classes
JavaScript classes are templates for creating objects. They encapsulate data with methods and support constructor methods.
Worked example
How it reads
- constructor(...) initializes the new object properties
- this refers to the specific instance of the class

Cloud tip: Class syntax is syntactical sugar over JavaScript's existing prototype-based inheritance model.


