I\'m stuck how i sum two object like this:
obj1 = { \'over_due_data\': 10, \'text_data\': 5 } obj2 = { \'over_due_data\': 20, \'text_data\': 5 } <
Another possible solution, using Array#reduce.
Array#reduce
var obj1 = {'over_due_data':10,'text_data':5}, obj2 = {'over_due_data':20,'text_data':5}, obj = Object.keys(obj1).reduce(function(s,a) { s[a] = obj1[a] + obj2[a]; return s; }, {}) console.log(obj);