JavaScript Merge Modification em objetos
//return modified data from tow objects
function mergeObject(obj1, obj2) {
var obj3 = {};
//loop through obj1 and obj2 and check if the attribute is diferent in obj1 and obj2
//if it is, then merge the value
for (var attrname in obj1) {
if (obj1[attrname] != obj2[attrname]) {
obj3[attrname] = obj1[attrname];
}
}
return obj3;
}
Wa7ch Tennin