DEV Community

Discussion on: What is Javascript's `new` keyword doing under the hood?

 
vincecampanale profile image
Vince Campanale

Ah okay, I see what you're saying now. I guess part of what I was trying to convey is that the constructor function can in fact return any object. In which case, the new function should just return that object as is.

What you've presented here is a more realistic edge case. I will think about a way to cover it in the article.

Great insights -- thank you.