Class Methods

This lesson teaches us how to define methods inside a class and explains the use of get/set methods in classes.

Defining Methods in a Class

A class constructor encapsulates all properties and methods. However, methods can also be defined outside the constructor in a class.

Whenever a method is declared inside a class, it gets defined on the prototype of that class. Hence, whenever an object instance ...