I found the problem, wasn’t in that function but in the previous one:

function validateCred(arr){

let sum = 0;

for (let i = arr.length -1; i >=0; i–){

```
if ((arr.length - i)%2 === 0 ){
arr[i] *=2;
if(arr[i] > 9){
arr[i] -= 9;
}
```

}sum += arr[i];

}

if (sum %10 === 0){

return true;

}

return false;

}

The function by itself was working but I was mutating the output on the findInvalidCard func because I was mutating the original array on the line arr[i] *=2… I needed to assign that to new variable… by the way problem solved.

Thanks a lot.