@extra-array/contains

1.1.7 • Public • Published

Check if an array contains another array.

const contains = require('@extra-array/contains');
// contains(<array1>, <array2>, [begin1=0], [end1], [begin2=0], [end2])

var a = ['b', 'l', 'i', 's', 's'];
var b = ['f', 'i', 's', 'h'];
contains(a, b);
// false (bliss ![c] fish)
contains(a, b, 1);
// false (liss ![c] fish)
contains(a, b, 1, 4);
// false (lis ![c] fish)
contains(a, b, 1, 4, 1);
// false (lis ![c] ish)
contains(a, b, 1, 4, 1, 3);
// true (lis [c] is)

With extra-array try Array.contains() instead.


extra-array

Package Sidebar

Install

npm i @extra-array/contains

Weekly Downloads

75

Version

1.1.7

License

MIT

Unpacked Size

2.96 kB

Total Files

5

Last publish

Collaborators

  • wolfram77