Lodash - isEqual method


Advertisements

Syntax

_.isEqual(value, other)

Performs a deep comparison between two values to determine if they are equivalent.

Arguments

  • value (*) − The value to compare.

  • other (*) − The other value to compare.

Output

  • (boolean) − Returns true if values are equivalent, else false.

Example

var _ = require('lodash');
var object = { 'a': 1 };
var other = { 'a': 1 };
 
console.log(_.isEqual(object, other));
console.log(object === other);

Save the above program in tester.js. Run the following command to execute this program.

Command

\>node tester.js

Output

true
false
lodash_lang.htm
Advertisements