Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1990

Static Members In JavaScript

$
0
0
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.


Code:
function Shape(){

    //here...
Static Members In JavaScript

Viewing all articles
Browse latest Browse all 1990

Trending Articles