Below typescript code
class MyClass{
test1 = function(){
}
test2(){
}
}
generates
var MyClass = (function () {
function MyClass() {
this.test1 = function () {
};
}
MyClass.prototype.test2 = function () {
};
return MyClass;
})();
I used to have javascript named function within a module, normally for recursion etc. Is it possible to have a function, within a class, assigned to a variable, or a named function which is not part of prototype or this. something like test3 and test4 below.
var MyClass = (function () {
function test3(){
}
var test4 = function(){
}
function MyClass() {
this.test1 = function () {
//test3 and test4 are accessible here..
};
}
MyClass.prototype.test2 = function () {
};
return MyClass;
})();
recur(pid){ ... ;...; _.each(ch, (c) => {...; recur(c.Id)}} ;. I thought it is neater not to add recur to prototype, though it works.