Is there any reason to manually `return` in a constructor function?
问题 Typically, in a constructor function, the object that is bound to this within the function is returned by it when it is called with the new prefix. But I would imagine that it's also possible (I think I even read this in crockford's book) to manually return your own value. Are there any places where such a practice is useful? 回答1: If you return a value type from the constructor, you'll get different behavior depending on if new was used. That's how String works. Look at this object in your