
Untitled
By: a guest on
Jun 19th, 2012 | syntax:
JavaScript | size: 0.62 KB | hits: 17 | expires: Never
var base_obj = {
one:{
A:{
x:'ok'
, y:'cool'
, z:'stuff
}
, B:'val'
}
, two:{
C:'something'
, D: 'whatever'
}
, three:'data'
};
var overrides = {
one:{
A:{
z:'the new stuff'
}
}
, three:'the new data'
};
// Want this result:
{
one:{
A:{
x:'ok'
, y:'cool'
, z:'the new stuff
}
, B:'val'
}
, two:{
C:'something'
, D: 'whatever'
}
, three:'the new data'
}