<script language= "Web Effects" >
<!--
function each (list, fun) {
for (var i = 0, len = list.length i < len; i++) {Fun (list[i], i);}
};
var arr = [1,2,3,4,1,3]
var t
Each (Arr.sort (), function (o,i) {
if (i>0 && o = = t) {alert ("same:" + O);}
Alert (t)
t = o;
})
-->
</script>
Method Three
function Filterarray (Str,array) {//This function is to filter the duplicated elements in the array, does not allow the insertion of NULL values, functions return an array
var isnull = false;
if (str = = "" | | str = NULL | | str = = ' undefined ') {
IsNull = true;
}
var newnum = 0;
var newarray = [];
var num = array.length;
if (num = 0) {
if (!isnull) {
Newarray[num] = str;
}
}else{
for (Var m=0;m < num;m++) {
if (str = = Array[m]) {
Break
}else{
newarray[newnum++] = array[m];
}
}
if (!isnull) {
newarray[newnum++] = str;
}
}
return newarray;
}
Other methods
<script>
Alert ("1,11,1.11,1111,111,11,1,1.11". Match (/(d+ (?:. d+)?) (?!. *,)/g))
</script>
<script>
Alert ("123450,0,1,2,5,3,2,12,4,1,1,123450". Match (/(d+) (?!. *, (, |$))/ig)
</script>
<script>
Alert ("123450,0,1,2,5,3,2,12,4,1,1,123450". Match (/(d+) (?!) (?:, [^,]+) *, (?:, |$))/ig))
</script>