Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

array-equal

sindresorhus12.8mMIT2.0.0TypeScript support: included

Check if two arrays are equal

array, equal, equals, same, identical, equality, compare, validate

readme

array-equal

Check if two arrays are equal

It checks that the elements and order are the same.

Install

npm install array-equal

Usage

import arrayEqual from 'array-equal';

arrayEqual([1, 2, 3], [1, 2, 3]);
//=> true

arrayEqual([1, 2, 3], [1, 2, 3, 4]);
//=> false