Hi I have written below code
function unique(th){
var obj = {};
for(var i = 0, n = th.length; i < n ; i++){
obj[th[i]] = th[i];
}
obj.length = n ;
return Array.prototype.slice.call(obj);
}
But, this is giving me unwanted output. Please help me to correct this. here is the fiddle.