3 ms·
Also, the latter syntax names the function for the stack frame, which is useful for debugging. You will sometimes see MyClass.prototype.myFunc = function myFunc
by moron4hire 13y ago
Also, the latter syntax names the function for the stack frame, which is useful for debugging. You will sometimes see MyClass.prototype.myFunc = function myFunc_(){}, because otherwise myFunc is only an anonymous function assigned to a property on the prototype object.
And the trailing underscore is to placate some version of IE. Or something. I can't keep it all strait when I'm just out of bed.
- thedufer 13y agoThat double-naming thing is going out of fashion, since modern browsers + node.js all know how to figure out function names without it.
- deleted 13y ago[deleted]