Friday, March 22, 2019

Javascript static members







I have a problem with javascript. What I intend to do is to simulate a class named Tooltip. Ex:



var Tooltip = function(){

this.draw = .....;
/////////// other members and methods

this.Static = ...; // this one I want to be static }


The problem is I can't find a method to declare a static method/member. And I presume that the above way doesn't work.
Is there any method to simulate a class with a static member? (preferably using object literals)



LE: I forgot to tell that I want to have acces to the static members from an instance of the class.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...