Programming, Computer Science, JavaScript, Functional Programming.
return set.slice(0, i).concat(n).concat(set.slice(i)); } export function isEmpty(set: NumberSet) : boolean { return set.length === 0; } export function has(n: number, set: NumberSet) : boolean { for (const num of set) { if (num === n) return true; } return false; } export function union( set1: