array-equal

  • Version 2.0.0
  • Published
  • 2.88 kB
  • No dependencies
  • MIT license

Install

npm i array-equal
yarn add array-equal
pnpm add array-equal

Overview

Check if two arrays are equal

Index

Functions

Functions

function arrayEqual

arrayEqual: <T, U>(array1: T[], array2: U[]) => array1 is T[];
  • Check if two arrays are equal.

    It checks that the elements and order are the same.

    Parameter array1

    The first array to compare.

    Parameter array2

    The second array to compare.

    Returns

    A boolean indicating whether the arrays are equal.

    Example 1

    import arrayEqual from 'array-equal';
    arrayEqual([1, 2, 3], [1, 2, 3]);
    //=> true
    arrayEqual([1, 2, 3], [1, 2, 3, 4]);
    //=> false

Package Files (1)

Dependencies (0)

No dependencies.

Dev Dependencies (2)

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/array-equal.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/array-equal)
  • HTML
    <a href="https://www.jsdocs.io/package/array-equal"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>