There is only one exception in the returned value that I am aware of.
If the constructor function returns an object then instead of the newly created object that object will be returned. The return statement will be ignored if it is of a primitive type.
Hi Ankur you are absolutely right. I mentioned about the non-null object, but intentionally dropped the primitive value return as that would surely confuse beginners, but I think i should add it for the sake of completeness.
Ankur Rajput
This is really good.
There is only one exception in the returned value that I am aware of. If the constructor function returns an object then instead of the newly created object that object will be returned. The return statement will be ignored if it is of a primitive type.