Lodash - eq method


Advertisements

Syntax

_.eq(value, other)

Performs a SameValueZero 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 the values are equivalent, else false.

Example

var _ = require('lodash');

console.log(_.eq('a', 'a'));
console.log(_.eq('a', Object('a')));

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