Why is this not working I don’t see how there is a difference in the output.
My code:
var removeDuplicates = function(nums) {
//let newArr
let newArr = [];
let ht = {};
for(let i=0; i< nums.length; i++){
//create a ht index
if(ht[nums[i]] === undefined){
ht[nums[i]] = 1
}
}
for(t in ht){
let newT = parseInt(t)
newArr.push(newT)
}
console.log(newArr)
return newArr
};