unordered-array-match

1.2.1 • Public • Published

unordered-array-match

npm XO code style Build Status codecov

Shallow check two arrays contain the same items in any order

Installation

npm install --save unordered-array-match

Usage

const unorderedArrayMatch = require('unordered-array-match');

unorderedArrayMatch(['a', 23, 'pineapple'], ['pineapple', 'a', 23]);  // true
unorderedArrayMatch(['a', 'b', 'c', 1, 2, 3], [3, 'c', 2, 'b', 1, 'a']);  // true
unorderedArrayMatch(['a', 23], [23, 'a', 'coconut']);  // false
unorderedArrayMatch(['a', 23], [42]); // false

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i unordered-array-match

    Weekly Downloads

    2

    Version

    1.2.1

    License

    MIT

    Last publish

    Collaborators

    • jacobwarduk