Skip to content

Using the Luhn algorithm, here are some functions on javascript to check if credit card numbers are valid.

Notifications You must be signed in to change notification settings

julienmcoding/creditCartChecker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

The credit card checker

A Codecademy javascript challenge, based on Luhn algorithm.

Table of contents

Project goals

Context: The company that you work for suspects that credit card distributors have been mailing out cards that have invalid numbers. In this project, I have the role of a clerk who checks if credit cards are valid. Every other clerk currently checks using pencil and paper, but I’ll be optimizing the verification process using functions and loops to handle multiple credit cards at a time. Unlike the other clerks, I want to spend the rest of your time relaxing!

Technology

Project is created with:

  • ES6 Javascript

Launch

First download the project.

To check is a card number is valid:

console.log(validateCred(cardNumber));

To check which credit cards are invalid:

console.log(findInvalidCards(batch));

To determine which companies own the invalid credit cards

console.log(idInvalidCardCompanies(batch));

To see the result, run node:

node main.js

Source

This project was created by Codecademy for the Back-End engineer path.

About

Using the Luhn algorithm, here are some functions on javascript to check if credit card numbers are valid.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published