how to check if one array contains another smaller array's values javascript code example
Example 1: angular one array contains any of second
const found = arr1.some(r=> arr2.includes(r))
Example 2: javascript is array a subset of array
const PlayerOne = ['B', 'C', 'A', 'D'];
const PlayerTwo = ['D', 'C'];
const result = PlayerTwo.every(val => PlayerOne.includes(val));
console.log(result);