2 ms·
That would be horrible in JS. All functions would have to have an explicit frist parameter that would be often unused, because you don't know how someone will u
by megous 8y ago
That would be horrible in JS. All functions would have to have an explicit frist parameter that would be often unused, because you don't know how someone will use the function.
function x(obj, param1) {}
class X {}
X.prototype.x = x;
o = new X();
o.x(123);
- tyingq 8y agoWell, yes, you would have to only apply it to methods, as Python and Perl do. I'm not suggesting it's practical to graft all that into JS at this point.