Static properties and methods are those that don’t change with one instance to another instance.
Also, if we declared static function then these functions can be used without creating an object of a class.
In javascript, there is no special syntax to denote static member but we can make use of constructor function name to declare static fields or static methods in Javascript.
The static variable is not created every time when an object is created.
Static Members In JavaScript
Also, if we declared static function then these functions can be used without creating an object of a class.
In javascript, there is no special syntax to denote static member but we can make use of constructor function name to declare static fields or static methods in Javascript.
The static variable is not created every time when an object is created.
Code:
function Shape(){ //here...