There are many cases where knowing when an array is a subset of another can be pretty useful - and although usually immediately obvious to the human eye, it can be difficult to evaluate in code. In the code below, is a of , but is not. arr2 subset arr1 arr3 let arr1 = [ 'a', 'b', 'c' ]; let arr2 = [ 'b', 'c' ]; let arr3 = [ 'c', 'd' ]; If we want to find out if an array is a subset of another array, the best way to evaluate this is by using the . This method iterates through each element in an array and performs a test on it. If every element in the array passes that test, then the overall method will return true. array every method every For each evaluation, we have a "parent" array, and a "subset" array - where we want to check if the "subset" array is fully contained within the "parent" array. To evaluate if one array is a subset of another, we can run on each element on the "subset" array. Within the function, we can test if the "parent" array contains each element in the "subset" array. If it does, then will return . Otherwise, it'll return . every every every true false This can be accomplished easily with a function like the one shown below - will return should the be fully contained within the : checkSubset true subsetArray parentArray let arr1 = [ 'a', 'b', 'c' ]; let arr2 = [ 'b', 'c' ]; let arr3 = [ 'c', 'd' ]; let checkSubset = (parentArray, subsetArray) => { return subsetArray.every((el) => { return parentArray.includes(el) }) } checkSubset(arr1, arr2); // returns true checkSubset(arr1, arr3); // returns false Also published here.