console.log(difference([1, 2, 3], [100, 2, 1,9, 10]));
function difference(setA,setB)
{
var union = new Set(setA);
console.log('union 1st : '+setA);
console.log('union 2nd : '+setB);
console.log('-------------');
for (var i=0; i<setB.length ; i++) {
union.add(setB[i]);
}
return union;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: