function myClass()
{
this.pubVar = 'hello public';
var priVar = 'hello private';
}
myClass.staticMethod = function()
{
}
I tried alert(this.pubVar), and alert(priVar)without success. What am I doing wrong?
I will change the question a little. I did not explain this for the first time.
How to declare static variables in a class?
I know that with java it's simple, you just put a static infront of type variable and presto, you have a static variable. I can not find this parameter for javascript ..
source
share