4 ms·
Can you give a short gist of why they're bad and why should one move out of classes/new? What is the alternative?
by Demiurge 12y ago
Can you give a short gist of why they're bad and why should one move out of classes/new? What is the alternative?
- davej 12y agoFrom the video: function constructor(spec) { let {member} = spec, {other} = other_constructor(spec), method = function () { // accesses member, other, method, spec }; return Object.freeze({ method, other, }); }
- miralabs 12y agoits mostly because of 'this' . as per the example above, you can prevent this by doing something like that.. freeze/seal