30 seconds of code

  Back to Home

includesAny

arraybeginner

Returns true if at least one element of values is included in arr , false otherwise.

Use Array.prototype.some() and Array.prototype.includes() to check if at least one element of values is included in arr.

const includesAny = (arr, values) => values.some(v => arr.includes(v));