intersectionintermediateconst a = new Set([1, 2, 3])
const b = new Set([2, 3, 4])
const common = a.intersection(b)
console.log([...common]) // β [2, 3]Use Set.intersection() to get the values present in both sets.
setA.intersection(setB) returns a new Set with elements common to both.
Challenge: Verify the intersection of two Sets.