1.1.7 • Published 6 years ago
@extra-array/contains v1.1.7
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.