xxipvg
Last Updated: February 25, 2016
·
578
· riyadhalnur

Compare object equality the easy way in JS

If you have ever been in a situation where you have to compare a JavaScript object with another down to every single property for equality (or a deep comparison), lodash has an awesome function that will do just that and return either a true or false.

var ob1 = {};
var ob2 = {};

var obequality = _.isEqual(ob1, ob2);