@extra-array/contains
v1.1.7
Published
Check if an array contains another array.
Downloads
2
Maintainers
Readme
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.