arr-equal

1.1.7 • Public • Published

arr-equal

GitHub version npm version NPM monthly downloads Build Status Dependency Status Coverage Status Known Vulnerabilities

Check if two arrays are equal with options (deep? shallow? ...)

Deep comparison compares arrays recursively.

Other type of objects (objets, buffers, ...) are still compared with strict equality (===).

Author: Loïc Formont
License: MIT Licensed
Example

var equal = require("arr-equal");
 
equal([1, 2, 3], [1, 2, 3]) ==> true
 
equal([1, 2, 3], [1, 3, 2]) ==> false
equal([1, 2, 3], [1, 3, 2], {order: false}) ==> true
 
equal([1, [2, 3]], [1, [2, 3]]) ==> false
equal([1, [2, 3]], [1, [2, 3]], {deep: true}) ==> true

Readme

Keywords

none

Package Sidebar

Install

npm i arr-equal

Weekly Downloads

1

Version

1.1.7

License

MIT

Last publish

Collaborators

  • pouc