I have two object arrays like -
var arrayOne = [{"Content":1, "ValueContent":2},{"Content":3, "ValueContent":4}]
var arrayTwo = [{"Ex": "x", "ValueNum":20,"Content_Key":3}, {"Ex":"y","ValueNum":10,"Content_Key": 1}]
I want to match Content
value from arrayOne
to Content_Key
value in arrayTwo
. If its a match the update arrayTwo
with ValueContent
from arrayOne
. So the updated array would look like -
var arrayTwo = [{"Ex": "x", "ValueNum":20,"Content_Key":3, "ValueContent":4}, {"Ex":"y","ValueNum":10,"Content_Key": 1, "ValueContent":2}]
Any leads on how to do this? Currently i am able to the matching part but beyond that am stuck.