In JavaScript, how do I test that one array has the elements of another array?
arr1 = [1, 2, 3, 4, 5] [8, 1, 10, 2, 3, 4, 5, 9].function_name(arr1) # => t
ES6 solution using includes:
includes
[1].every(elem => [1,2,3].includes(elem));
Very similar to Explosion Pills's solution above, just a bit more readable (and arguably a tiny, tiny bit slower).