Context: The company that you work for suspects that credit card distributors have been mailing out cards that have invalid numbers.
These functions were created to practice Javascript ES6 (functions, arrays manipulation, loops) learned in Codeacademy Full-Stack Engineer career path. The project is called "Challenge Project: Credit Card Checker".
In this project, you have the role of a clerk who checks if credit cards are valid. Every other clerk currently checks using pencil and paper, but you’ll be optimizing the verification process using your knowledge of functions and loops to handle multiple credit cards at a time.
- The purpose of validateCred() is to return true when an array contains digits of a valid credit card number and false when it is invalid. This function should NOT mutate the values of the original array.
- The role of findInvalidCards() is to check through the nested array for which numbers are invalid, and return another nested array of invalid cards.
- idInvalidCardCompanies() should return an array of companies that have mailed out cards with invalid numbers. This array should NOT contain duplicates
- Use different credit card numbers from a credit card number generator and validator site and test if your functions work for all types of credit cards.
- To make it easier to test credit card numbers, create a function that accepts a string and converts it into an array of numbers like the initially provided arrays.
- Create a function that will convert invalid numbers into valid numbers.
Feel free to comment and give me advice to correct my mistakes and continue to improve. Thanks a lot in advance.