Say I have two arrays of objects, like so:
var arr1 = [{name: \'Jay\'}, {name: \'Bob\'}];
var arr2 = [{age: 22}, {age: 30}];
I want a combined
A more loosely coupled solution would be by using merge functionality of lodash library.
This will be independent of the number of keys and key names you have in object. So in future if you decide to add keys to your object, you won't need to update the code to merge your objects.
var _ = require('lodash');
var arr1 = [{name: 'Jay'}, {name: 'Bob'}];
var arr2 = [{age: 22}, {age: 30}];
var arr3 = [];
for (var i=0; i