Created
April 8, 2026 15:24
-
-
Save petergi/2b6597cc66f83788183e43575612565b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Checks if all the elements in `values` are included in `arr`. | |
| // - 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)); | |
| // includesAll([1, 2, 3, 4], [1, 4]); // true | |
| // includesAll([1, 2, 3, 4], [1, 5]); // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment