Assume you have a JavaScript class, Car
. You can create an instance of it:
new Car()
It’s really just a constructor function:
function Car() {}
Then:
-
Car.prototype.method
is an instance method. -
this.var
insideCar()
constructor or an instance method is an instance variable. -
Car.var
is a static (class-level) variable. -
Car.method
is a static method.