When you are a new function constructor, an empty object is created and then refers to this inside the function constructor.
So, PersonA , think of it this way:
// create an empty object var emptyObj = {}; // call the function as a method of the empty object PersonA.call(emptyObj, "Bob", "Smith");
The result is emptyObj :
{ fname : "Bob", lname : "Smith" }
When you call PersonB , you still create an empty object, calling a new one , but essentially doing nothing with it, and return another object to it.
Steve source share