Credit Card Checker Challenge Project (JavaScript)

Hi @blopezpi
I just finished this project and broke my head about the validateCard extra function. I found a solution (https://discuss.codecademy.com/t/credit-card-checker-validate-cards/576841), but I don’t think it’s very elegant.
Would you mind telling me, what’s the idea behind yours?
I get that you store the returned rest of the sum % 10 (excluding the last digit) from the validateCred function and append it to the invalid card array. That increases the number of digits in most cards to 17. But why would it always pass the Luhn check if you get the rest excluding the last digit and append it to the card number?