function removeDuplicate(num){
var out=[];
var obj={};
for (x = 0; x < num.length; x++){
obj[num[x]]=0;
}
for (x in obj){
out.push(x);
}
return out;
}
var theNum = [1,1,2,3,3,3,4,4,5,6,7,7,7];
result = removeDuplicate(theNum);
alert(theNum);
alert(result);
hi everyone, I'm new to programming and I can't figure out how this solution works, it sounds to me like it's assigning Zero's into that object for every elements in that array...?
and for each x in object, insert them into array?... what values the X's carry at that point?
thank you so much for any helps