Credit Card Checker Challenge Project (JavaScript)

Hey guy! Here’s the link to mine.

1 Like

My WorkSpace → https://www.codecademy.com/workspaces/6433552acaa92dbaf04bae2f

Hello all - from testing the below code, it seems to be working as it should. Any feedback, constructive criticism would be appreciated - thank you in advance!

I tried. This one was tough. credit-card-checker

https://github.com/marcellinas/credit-card-checker/blob/813cffb25fbfd96070b2778413a4756f9edf64b3/main.js

here is my solution

Alrock Credit Card Checker

Hi ! My solution :slight_smile:

CodeCademy/Challenge Project: Credit Card Checker at main · jmanrique5/CodeCademy (github.com)

here is mine Challenge-Project-Credit-Card-Checker/hello.js at main · moyersson/Challenge-Project-Credit-Card-Checker · GitHub

front_end_codecademy/building_interactive_websites at main · rcepedaraza/front_end_codecademy · GitHub

Hi,
Here is my solution.

my solution. I would be really happy to receive any feedback as it’s my first time sharing my code with other developers.

here is my solution feel free to check it out :slight_smile:

Please see my solution below as well, it is a bit different to the above:

https://felipegomesoo.github.io/creditCardChecker/main.js

Finally, I have finished this project. Had a tough time but enjoyed it.
Please check it out My work

because you’ve declared

const invalidCard = [];

outside of the findInvalidCards function, and then mutate it from within the function, if you call findInvalidCards multiple times, invalidCard will keep getting longer and longer.

because you’re only calling findInvalidCards(batch) the one time, here, it works fine. But if you then wanted to check a second batch of cards, you end up with a single array containing all the cards you’ve ever checked, which you might not want.

I think it would make the function more reusable if you declare the empty array inside the function instead of outside it, so you you can assign the array it returns to whatever variable you like, and if you have multiple separate batches of cards to process you could do like

const invalidCards1 = findInvalidCards(batch);
const invalidCards2 = findInvalidCards(batch2);

whereas with your version if you have to process two batches you’d need to do

findInvalidCards(batch);
findInvalidCards(batch2);

and then they’ll both end up sharing space in invalidCard and you won’t be able to tell which company’s cards came out of which batch.

Here is My solution…

Hello everyone :wave:t3:
Here’s my solution for this project.
Feedback is welcome. Please point out any improvement opportunities.

Hi, this is my solution. I’ll appreciate if you can check it out and give me some feedback. Thanks

Hi, here is my solution plus some of the extra points of the exercise:
(creditCardChecker.js · GitHub)

greetings!