Hey guy! Here’s the link to mine.
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
here is my solution
Hi ! My solution
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
Please see my solution below as well, it is a bit different to the above:
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
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…
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)