Open
Description
Please consider the following code:
var a = { "debug" : true, "hagemashi" : "yasashii", "okuritai" : {
"koto" : "ichi",
"mono" : "ni"
}
};
console.log( a );
var b = { "debug" : false, "hagemashi" : "yasashikunai", "okuritai" : {
"koto" : "san",
"mono" : "shi"
}
};
console.log( merge.recursive( false, a, b ) );
console.log( a );
Outputs
{ debug: true,
hagemashi: 'yasashii',
okuritai: { koto: 'ichi', mono: 'ni' } }
{ debug: false,
hagemashi: 'yasashikunai',
okuritai: { koto: 'san', mono: 'shi' } }
{ debug: true,
hagemashi: 'yasashii',
okuritai: { koto: 'san', mono: 'shi' } }
I was assuming the last two outputs would be identical since the intention is to modify the original object. Am I using it incorrectly?
Metadata
Metadata
Assignees
Labels
No labels