495 B
495 B
title, tags, firstSeen, lastUpdated
| title | tags | firstSeen | lastUpdated |
|---|---|---|---|
| includesAll | array,beginner | 2019-11-04T21:37:16+02:00 | 2020-10-20T23:02:01+03:00 |
Checks if all the elements in values are included in arr.
- Use
Array.prototype.every()andArray.prototype.includes()to check if all elements ofvaluesare included inarr.
const includesAll = (arr, values) => values.every(v => arr.includes(v));
includesAll([1, 2, 3, 4], [1, 4]); // true
includesAll([1, 2, 3, 4], [1, 5]); // false