function clone(object) {
function F() {}
F.prototype = object;
return new F;
}
var CompoundObject = {
string1: 'default value',
childObject: {
bool: true,
num: 10
}
}
var compoundObjectClone = clone(CompoundObject);
compoundObjectClone.childObject.num = 5;
function F() {}
F.prototype = object;
return new F;
}
var CompoundObject = {
string1: 'default value',
childObject: {
bool: true,
num: 10
}
}
var compoundObjectClone = clone(CompoundObject);
compoundObjectClone.childObject.num = 5;