array-includes-all

2.0.0 • Public • Published

array-includes-all

npm version Build Status Coverage Status

Check if an Array includes all the elements of another array

arrayIncludesAll(['a', 'b', 'c'], ['a', 'b']); //=> true
arrayIncludesAll(['a', 'b', 'c'], ['a', 'b', 'd']); //=> false
 
arrayIncludesAll([1, 2, NaN], [NaN]); //=> true

Installation

Use npm.

npm install array-includes-all

API

import arrayIncludesAll from 'array-includes-all';

arrayIncludesAll(array, searchElements [, fromIndex])

array: Array
searchElements: Array (the elements to search for)
fromIndex: integer (the position in the array at which to begin searching)
Return: boolean

The API is similar to Array.prototype.includes.call, except that the second argument takes an array of the elements to search for instead of a single element.

arrayIncludesAll([1, 2], [1, 2]); //=> true
arrayIncludesAll([1, 2], [1, 2], 1); //=> false

License

ISC License © 2018 Shinnosuke Watanabe

/array-includes-all/

    Package Sidebar

    Install

    npm i array-includes-all

    Weekly Downloads

    204

    Version

    2.0.0

    License

    ISC

    Unpacked Size

    5.23 kB

    Total Files

    5

    Last publish

    Collaborators

    • shinnn