Hi,
I am stuck in the creditcard checker. I don’t know where to start and it’s overwhelming. I am trying out some things and I know I need to use: reverse(), a for loop and if statement. Can someone help me with this?
Ofcourse I can search the forum for solutions but then I still don’t get it and someone else’s code is overwhelming to me.
This is what I have for now.
const validateCred = (valid1) => {
let array = valid1;
let reversedArray = array.reverse();
for(i = 0; i <= reversedArray.length; i++) {
if(i === i *= 2) {
return ...;
} else {
return 'Invalid'
}
}
};
console.log(validateCred());
Thank you in advance.
Rosita