var arr = [1, 2, 2, 2, 2, 4, 5, 6, 6, 6, 6, 8, 8, 9, 9, 99]
for (var i = 0; i < arr.length; i++) {
for (var j = i + 1; j < arr.length;) {
if (arr[i] === arr[j]) {
arr.splice(j, 1);
} else {
j++;
}
}
}
console.log(arr)
var arr = [1, 2, 2, 2, 2, 4, 5, 6, 6, 6, 6, 8, 8, 9, 9, 99]
for (var i = 0; i < arr.length; i++) {
for (var j = i + 1; j < arr.length;) {
if (arr[i] === arr[j]) {
arr.splice(j, 1);
} else {
j++;
}
}
}
console.log(arr)