Question: So I have a code running with something like this:

```
maxRow = 5

For numRow=1 to maxRow

    If Range("A" & numRow).Value = 0 Then

        Rows(numRow).Select

        Selection.Delete Shift:=xlUp

        numRow = numRow - 1 

        maxRow = maxRow - 1 

    End If

Next numRow

```

and I have 

> 
> A1 to A5 = 4 0 3 1 9 (respectively)
> 
> 
> 

yet for some reason the loop keeps going 

Anyone please help me so I end up with A1=4, A2=3, A3=1 and A4=9 without continuous looping.

Answer: 
```
var isUnique = function(v,i,arr){
   // return true if the first occurrence is the last occurrence 
   return ( arr.indexOf(v) === arr.lastIndexOf(v) ); 
};

var uniqueVals = myArr.filter(isUnique);

console.log( uniqueVals );

```
var **yourArray** = [1, 2, 1, 3];

```
        var uniqueValues = [];
        $.each(yourArray, function (i, value) { //taking each 'value' from yourArray[]
            if ($.inArray(value, uniqueValues) === -1) { 
                 uniqueValues.push(value); // Pushing the non - duplicate value into the uniqueValues[] 
            }
        });            
        console.log(uniqueValues);

```

**Result**: [1,2,3];