Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Are these two values conceptually equal?
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.jscs.json
.travis.yml
CHANGELOG.md
LICENSE
Makefile
README.md
index.js
package.json
test.js

README.md

is-equal Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

Are these two values conceptually equal?

Example

var isEqual = require('is-equal');
var assert = require('assert');

var primitives = [true, false, undefined, 42, 'foo'];
primitives.forEach(function (primitive) {
    assert.equal(isEqual(primitive, primitive), true);
});
assert.equal(isEqual(/a/g, /a/g));
assert.equal(isEqual(/a/g, new RegExp('a', 'g')));
assert.equal(isEqual({ a: 2 }, { a: 2 }), true);
assert.equal(isEqual([1, [2, 3], 4], [1, [2, 3], 4]), true);
var timestamp = Date.now();
assert.equal(isEqual(new Date(timestamp), new Date(timestamp)), true);

Tests

Simply clone the repo, npm install, and run npm test

Something went wrong with that request. Please try again.