For a function returning a new object, it could be used as a factory method, or a constructor function, to create new object, like below:
function Person()
{
var o=new Object();
o.age=30;
return o;
}
var p1=Person();
var p2=new Person();
console.log(typeof(p1)==typeof(p2))
I wonder what's the core difference between p1 and p2 -------- p1 is created directly from the function, p2 is created by the constructor symantics. So p1 and p2 have identical structure, or they have some suttle differences?
Or, is there any difference between objects that are created using "new" or without "new"?