Is there any way to get Underscore.js extend function:
Copy all of the properties in the source objects over to the destination object, and return t
Stand-alone version of Bergi's deep extend, including the fix for when a value is a string instead of an object. Also patched to be more strict.
function deepObjectExtend (target, source) {
for (var prop in source) {
if (source.hasOwnProperty(prop)) {
if (target[prop] && typeof source[prop] === 'object') {
deepObjectExtend(target[prop], source[prop]);
}
else {
target[prop] = source[prop];
}
}
}
return target;
}