Skip to content

Comment on Node.js Best Practicesparent

Comments

If you accidentally forget to use 'new' when you're supposed to, the "constructor" method will change the global object instead of a new object, it can cause strange behavior that is very hard to trace.

Ah, I see. I guess I've never forgotten to use new. That does sound incredibly annoying to debug.

AboutSource Built by g1lg1l

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