Skip to content

Comment on Stop Using Constructors in JS (2012)parent

Comments

Personally, I think this makes it unclear what the code actually does--IMHO, forgetting `new` is not a real concern.

I generally just add a `create` method to the prototype so that you can do things like, `_.map(items, Constructor.create)`

The issue has very little to do with forgetting "new" and more to do with hiding implementation details and improving module composability.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.