Cash register

from FreeCodeCamp

Enter a purchase price and customer payment

Enter the current cash in register

Cash register status:


The project

Design a cash register drawer function checkCashRegister() that accepts purchase price as the first argument (price), payment as the second argument (cash), and cash-in-drawer (cid) as the third argument.
The checkCashRegister() function should always return an object with a status key and a change key.

I completed this challenge as a way to practice and learn more about JavaScript. You can find the source code on my Github account.
If you have any suggestion regarding accessibility, optimisation, or anything, I would be extremely happy to hear about them on my GitHub account. Don't hesitate to give me a hand so that I become a better web developper !

Check my portfolio on