I've created 2 objects (object1 and object2) using different ways.
I found no difference between them, except for the way how it is displayed in the Chrome Dev Console (see this in the below screenshot)
var F;
function create(parent, properties) {
F = function(p) {
for(var i in p){
this[i] = p[i].value;
}
};
F.prototype = parent;
return new F(properties);
}
var prop={ p: { value: 42 } };
var masterObject = {a: "masterObject value"}
var object1 = create(masterObject, prop);
var object2 = Object.create(masterObject, prop);
Following are my questions:
As I'm following different ways to create objects, will there be any difference between the objects - object1 and object2?
What is the difference that can be seen in the above screenshot (encircled in red)?