数组和集合 / 无重复集合

let first = new Set([12])
let second = new Set([12])
let third = new Set([123])

let isEqual = 
    (first.size === second.size) &&
    ([...first]
        .filter(x => !second.has(x))
        .length === 0)
//isEqual is true

let isIntersects = [...first]
    .filter(x => third.has(x))
    .length > 0
//isIntersects is true

let isSubset = [...third]
    .filter(x => !first.has(x))
    .length === 0
//isSubset is false

console.log("isEqual is", isEqual)
console.log("isIntersects is", isIntersects)
console.log("isSubset is", isSubset)