Credit Card Checker Challenge Project (JavaScript)

You’re not actually increasing the value of i or j in your loops.
(The value of i was always 2, so it became an infinite loop.)

for (i = 2; i < arr.length; i + 2) {
should be
for (let i = 2; i < arr.length; i = i + 2) {

Notice that i + 2 should be i = i + 2 or i += 2 so that the value of i changes (increases by 2) for each iteration.

Similarly,
for (j = 1; j < arr.length; j + 2) {
should be
for (let j = 1; j < arr.length; j = j + 2) {
or something similar.

1 Like

Hey everyone. Think I got this working :sweat_smile:

Greetings to all from the UK. :slight_smile:

And here’s my funky solution :slight_smile:

1 Like

First time sharing GitHub, but here is the solution to my work:

Took me few hours to complete, but now I’m proud of myself for creating first JS project without looking at hints. Please feel free to check link with my code. Any feedback will be much appreciated.

hi everyone. Here is my solution.

Hi

Here I leave my solution for the Challenge Project: Credit Card Checker

Cheers
Ilan

Am I the only one with extreme difficulties in this? I cant even do the first step… Should I just quit learning js? :disappointed_relieved: So frustrating

Greetings,

Here is my solution for the Credit Card Checker Challenge. I managed to do the bonus questions, including the invalid to valid card converter. The converter alters the last and the third-last digits to get a valid card to match the algorithm. Feedback is appreciated.

Credit Card Checker Challenge Code

Cheers,
FS

1 Like

Don’t give up. I used to struggle like you.

1 Like

Any advices? Should I go back and do over and over again all the other topics?
Any other places I can learn more? youtube, books?
I really like this and I want to change my career but I’m feeling so frustrated and thinking I’m not smart enough for this :confused:

You might want to go back through the topics again and try to refrain from looking at the solutions from Get Unstuck. For challenges, you might want to look at other sources. I was once told that learning to code is like learning to swim.

Hi! :smile:
I would like to share my solution to this project with you.
Any feedback is welcome c:

carlos-garcia98/credit_card_checker

Happy Coding!