4 ms·
A JavaScript Constructor Problem, and Three Solutions
- facorreia 12y agoI like this thorough explanation. In my code, I mostly avoid this issue by relying on jshint's "newcap" option to detect when a constructor function is called without the new keyword.