Object.keys(obj2).forEach(function(key) { if (key in obj1) { // or obj1.hasOwnProperty(key) obj1[key] = obj2[key]; } });