How to compare two arrays, and if found the same key and then get the value from 2nd array and assign it to first array. And the result is using first array. for example I have the array below:
var compareit = {
firstArray : {
'color': 'blue',
'width': 400,
'height': 150,
},
secondArray: {
'color': 'red',
'height': 500,
},
};
The goal is, I want the result will : {'color': 'red', 'width': '400', 'height': '500'};
I really appreciate with any help...Thank you :)