+ 1

Why to use static function in JS

What are the advantages to static functions over normal functions. Does the scope of a static function different?

26th Jun 2018, 3:52 PM
Ole113
Ole113 - avatar
1 Resposta
+ 2
Static method calls are made directly on the class and are not callable on instances of the class. Generally - static methods or static members belong to class rather than instances of a class (object). See more on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static
26th Jun 2018, 5:27 PM
asa22