How can I merge these two objects in javascript?
h1 = {12: [{actor: 'wayne'}, {actor: 'bill'}], 13: [{actor: 'james'}]} h2 = {13: [{actor: 'mark'}]} to get:
result = {12: [{actor: 'wayne'}, {actor: 'bill'}], 13: [{actor: 'james'}, {actor: 'mark'}]} Basically I want to concat the arrays, based on the keys of the objects.
jQuery.extendanticipates this use-case. Maybe Underscore will.