I'm implementing a class template like this:
function Class() {
var _class = function () {
console.log("init");
this.init.apply(this, arguments);
}
_class.prototype.init = function () { };
return _class;
}
var Person = new Class;
var person = new Person("alice");
and I'm trying to figure out how _class is being called. Nothing I can see is calling init so why is it executing?