<script>
var arr=["a","e","w","f","a","g","d","r","e","b","f"];
var h=[];
var k=0;
var j=[];
for(var key in arr){
if(h[arr[key]]==undefined) h[arr[key]]=1;
}
for(var key in h){
j[k]=key;
k++;
}
console.log(j);
</script>
<script>
var arr=["a","e","w","f","a","g","d","r","e","b","f"];
var h=[];
var k=0;
var j=[];
for(var key in arr){
if(h[arr[key]]==undefined) h[arr[key]]=1;
}
for(var key in h){
j[k]=key;
k++;
}
console.log(j);
</script>