Hi all,
Could someone please tell me the best way to remove a duplicate string from an array, for example, if I have this script...
the output is
although, I'd like it to be ...
removing "tr4" as it appears twice,
Thanks
Could someone please tell me the best way to remove a duplicate string from an array, for example, if I have this script...
Code:
<html>
<body>
<script type="text/javascript">
var str="zz1,tr4,de6,q2q,tr4,qq0"
a=str.split(",")
for (i = 0; i <a.length; i++){
document.write(a[i]+"<br \/>")
}
</script>
</body>
</html>
the output is
Code:
zz1
tr4
de6
q2q
tr4
qq0
although, I'd like it to be ...
Code:
zz1
tr4
de6
q2q
qq0
Thanks