Compare Objects in lodash
Posted on: March 02, 2021 by Prince Chukwudire
In this article, you will learn how to compare objects in lodash.
Lodash is basically a JavaScript library that provides utility functions for functional programming.
Comparing objects with lodash can be achieved using the _.isEqual
method. Here’s how:
let object1 = {
firstName: "John",
lastName: "Doe",
};
let object2 = {
firstName: "Jane",
lastName: "Doe",
};
console.log(_.isEqual(object1, object2))
This returns false if objects are different.
Share on social media
//