Assume you have a JavaScript class, Car
. You can create an instance of it:
1 | new Car() |
It’s really just a constructor function:
1 | 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.