getting difference object from two objects using es6
问题 Im trying to figure out whats the best way to get an intersection object between two objects using es6. by this i mean something like: a = {a:'a',b:'b',c:'c', d:'d'}; b = {a:'a',b: '1', c:'c', d:'2', f'!!!'} // result I want: c = getDifference(a,b) //c is now: {b:'1', d:'2'} Is there a short way to do this using es6, or do I need to iterate over the a object using for(in) with Object.keys() and compare, assigning intersections to c? (a,b) => { const c = {}; for(const _key in Object.keys(a)){