Sunday 24 April 2016

Static self member in javascript







How can i make a static encapsulation with self members in javascript?
such as in php:



class bar{

static public $foo;
static public function set() {
self::$foo = 'a';
}
}
bar::set();


In javascript:
var bar = function () {

????????
}
bar.set();



Thanks!

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...