Below is the isSubSet()
function that checks if elements from subset B and subset C are in subset A are in the universal set.
const isSubSet = (universalSet,subSet) => (
subSet.every(element => element in universalSet)
)
const [setA,setB,setC ] = [ [1,2,3,4,5], [1,2,3],[1,2,3,4,5]]
const [checkA, checkB ] = [,isSubSet(setA, setC)]
console.log(`is setB subset of setA: ${isSubSet(setA, setB)}`)
console.log(`is setC subset of setA: ${isSubSet(setA, setC)}`)
Does the array.every() return true for proper subsets only?