Checks if at least one element of
values is included in
Array.prototype.includes()to check if at least one element of
valuesis included in
const includesAny = (arr, values) => values.some(v => arr.includes(v));
includesAny([1, 2, 3, 4], [2, 9]); // true includesAny([1, 2, 3, 4], [8, 9]); // false
Checks if the provided predicate function returns
true for at least one element in a collection.
Checks if all the elements in
values are included in
Applies a function against an accumulator and each element in the array (from left to right), returning an array of successively reduced values.