Programming, Computer Science, JavaScript, Functional Programming.
NumberSet, set2: NumberSet) : NumberSet { const newSet = []; let i = 0, j = 0; while (true) { if (i === set1.length) return newSet.concat(set2.slice(j)); if (i === set2.length) return newSet.concat(set1.slice(i)); if (set1[i] === set2[j]) { newSet.push(set1[i]); i++; j++; } else if (set1[i] <