I have tried to do it my way. For the first bit I tried to create a reverse loop. Its not taking the value given. It is not logging the final list either.

That won’t work for several of the numbers. Not all of the credit card numbers have 16 digits. Also you need to perform the doubling and possible subtracting of 9 on every other digit after skipping the last digit. Using the even-ness or odd-ness of the digit’s index in the array to determine which numbers to perform those actions on won’t work either on numbers with an odd number of digits.

You might need to re-consider your approach.

Also, I’d get away from using var. Use let or const. None of your variables require function scope. Block scope is sufficient for all of them.