Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by www.30secondsofcode.org #
 
PREVIOUS NEXT
Tagged: #javascript #check #array #subset
ADD COMMENT
Topic
Name
6+7 =