Answers for "javascript is array a subset of array"

0

javascript check if array is subset of another

let superSet = ['B', 'C', 'A', 'D'];
let subSet = ['D', 'C'];
let mixedSet = new Set([...superSet, ...subSet]);
let isSubset = mixedSet.size == superSet.length
Posted by: Guest on January-18-2021
0

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);
Posted by: Guest on January-23-2021

Code answers related to "javascript is array a subset of array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language