I have been working on the credit card checker project and I’m having a problem with the Id invalid card companies function.
I have decided to create variables for each credit of the card companies that are stored as booleans. Then I created a loop that runs through the first digit of each of the card numbers in my nested array of false card numbers and if for example ‘3’ shows up we will change the value of amex to true.
Then the function logs a string to the console for every card company that is stored as has the boolean value of true.
When I try to run my function it always comes up as undefined. There is obviously something fundamental that I am missing here, but I can’t figure it out.
I am going to re write the code and use a different method to solve the problem. But I think it would be helpful to know why this function isn’t behaving how I anticipated it would.
here is my code:
I would be grateful for any help