lodash difference between two objects code example
Example 1: lodash deep compare two objects
var bob = {"sex":"male","age":21};
var bill = {"sex":"male","age":21};
if(_.isEqual(bob, bill)){
//we are equal
}else{
//we are not equal
}
Example 2: lodash get difference between two arrays of objects
var presents = _.intersectionWith(array1, array2, _.isEqual);
var dif = _.differenceWith(array1, array2, _.isEqual);