30 seconds of code

  Back to Home

includesAll

arraybeginner

Returns true if all the elements ιν values are included in arr, false otherwise.

Use Array.prototype.every() and Array.prototype.includes() to check if all elements of values are included in arr.

const includesAll = (arr, values) => values.every(v => arr.includes(v));