Change = {status: “INSUFFICIENT_FUNDS”, change: []}; CashRegister @ FreeCodeCamp

Your check for insufficient funds is that there is more money in the drawer than needs to be given as change:
if (totalINdrawer < changeDue) { (L79)
You fed it a 20 dollar handin, and a 19.50 dollar charge, so the change was 0.50 cents.
You told it you have 1.01$ in the drawer.
1.01 > 0.5, so your if evaluated False; there is enough money to cover the change.

1 Like