is-deep-eq
v2.1.1
Published
Check if two arrays, objects, numbers or strings are equal.
Downloads
12
Maintainers
Readme
is-deep-eq
Check if two arrays, objects, numbers or strings are equal.
Install
Install with npm:
$ npm install --save is-deep-eq
Usage
var isDeepEqual = require("is-deep-eq");
console.log(isDeepEqual([1, 2, 3], [1, 2, 3]));
// => true
console.log(isDeepEqual({ key1: "val1" }, { key1: "val1" }));
// => true
console.log(isDeepEqual({ key1: 1 }, { key1: "1" }));
// => false
console.log(isDeepEqual(1, 2));
// => false
console.log(isDeepEqual([{ key1: "val" }], [{ key1: "val" }]));
// => true
console.log(isDeepEqual({ key1: [1, 2, 3] }, { key1: [1, 2, 3] }));
// => true
console.log(isDeepEqual(undefined, undefined));
// => true
console.log(isDeepEqual(undefined, {}));
// => false
License
Released under the MIT License.