JavaScript Static Methods

Static class methods are defined on the class itself

JavaScript Static Methods

Static class methods are defined on the class itself.

You cannot call a static method on an object, only on an object class.

If you want to use the myCar object inside the static method, you can send it as a parameter: