Hi! My Creditcard checker keeps crashing on what appears to me to be simple forloops. I can only imagine its the fault of the actual checker function, but I’ve made sure it only returns single digits?

```
// An array of all the arrays above
const batch = [valid1, valid2, valid3, valid4, valid5, invalid1, invalid2, invalid3, invalid4, invalid5, mystery1, mystery2, mystery3, mystery4, mystery5];
// Add your functions below:
const validateCred = arr => {
let temp = [];
for(i = arr.length-1; i >= 0; i--) {
if (i % 2 === 0) {
if ((arr[i] * 2) > 9) {
temp.push((arr[i] * 2) - 9);
} else {
temp.push(arr[i] * 2);
}
} else {
temp.push(arr[i]);
}
}
sum = (temp.reduce((a, b) => a + b, 0)) % 10;
return sum
}
const findInvalidCards = (nestedArray) => {
let invalidCards = [];
// test
for(i = 0; i < nestedArray.length; i++) {
console.log(validateCred(nestedArray[i]));
}
}
```