//I have a pair of objects
var obj1={
"name":"mayur",
"age":23
}
var obj2={
"name":"keyur",
"age":29,
"limit":54,
"surname":"godhani"
}
//I am familiar with one approach
var j1 = {name: 'Varun', age: 24};
var j2 = {code: 'NodeJS',name:'mayur', alter: 'C++'}
for (var key in j1) {
if(j2[key])
j1[key] = j2[key];
}
console.log(j1);
//However, I desire to do it using lodash or in just one line of code
//--> The expected results should be as follows
var obj1={
"name":"keyur",
"age":29
}