I am trying to merger two json to one json. I don't want merge all keys, I added my code. 
Code should be in javascript or node (underscore).

```
var json1 = [{user_id:1,friend_id:2,desc:'aaa'}, {user_id:3,friend_id:4,desc:'ccc'}, {user_id:1,friend_id:1,desc:'ccc'} , {user_id:1,friend_id:3,desc:'ccc'} ];

var json2 = [{reference_id:1,name:'A'},{reference_id:2,name:'B'},{reference_id:3,name:'C',age:30},{reference_id:4,name:'D'}];

```

Expecting Output:

output:

```
json1 = [{user_id:1,friend_id:2,desc:'aaa',user_name:'A',friend_name:'B'}, {user_id:3,friend_id:4,desc:'ccc',user_name:'C',friend_name:'D'}, {user_id:1,friend_id:1,desc:'ccc',user_name:'A',friend_name:'A'} , {user_id:1,friend_id:3,desc:'ccc',user_name:'A',friend_name:'C'} ];

```

Logic Js Code:

```
for (var i = 0; i < json1.length; i++) {
    var user_id = json1[i].user_id;
    var friend_id = json1[i].friend_id;
    for (var j = 0; j < json2.length; j++) {
        if (json2[j].reference_id == user_id) {
             json1[i].user_name = json2[j].name;
        }
        if (json2[j].reference_id == friend_id) {
             json1[i].friend_name = json2[j].name;
        }
    }
}

```

I attached my code in jsfiddle.[Click Here](https://jsfiddle.net/rajinikumarr/3wtuwmtf/)

The same code should be convert into underscore.