I am running into this issue, when i use Object.assign()
previous value getting overridden.
var blueprint = {
name: {
first: "Default first name",
last: "Default last name"
}
};
var person1 = Object.assign( {}, blueprint );
console.log( blueprint.name.first ); // Gives me "Default first name"
person1.name.first = "John";
console.log( blueprint.name.first ); // Gives me "John"
console.log( blueprint.name.last ); // Gives me "Default last name"
Question is how can i override person1.name.first while keep my blueprint safe?