Are these two values conceptually equal?
Example
var isEqual = ;var assert = ; var primitives = true false undefined 42 'foo';primitives;assert;assert;assert;assert;var timestamp = Date;assert;
Want to know why two values are not equal?
Will return an empty string if isEqual
would return true
- otherwise will return a non-empty string that hopefully explains the reasoning.
var whyNotEqual = require('is-equal/why');
assert.equal(whyNotEqual(1, 1), '');
assert.equal(
whyNotEqual({ a: 1 }, { a: 2 }),
'value at key "a" differs: numbers are different: 1 !== 2'
);
Tests
Simply clone the repo, npm install
, and run npm test