I am in need to compare two objects and update the values of the first object with the updated values from the second object. For example:
$scope.obj1={"id" : 1, "name" : "java"}
$scope.obj2={"id" : 1, "name" : "java4you", "gender" : "male"}
compare(destination, bj1, obj2);
Output in the Destination variable will be:
{"id" : 1, "name" : "java4you"}
Both objects above contain the same keys but different values. The goal is to compare obj1 and obj2 and update obj1 with values matching those in obj2.