Hey @kumenger!
Thanks for your hint
You code is a bit out of my frame of understanding and I think you will have to make some ugly things right after the if
statement to make it work, but I think I got it!
I’ll be nice and friendly and give you HINT back 
HINT: If your FCC tests pass, it doesn’t mean there are no bugs, my friend. For example, FCC solution fails this case:
const cid = [["PENNY",1], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 1], ["ONE", 1], ["FIVE", 5], ["TEN", 10], ["TWENTY", 20], ["ONE HUNDRED", 0]];
checkCashRegister(3, 3.01, cid);
If you post your solution, I’m almost certain that I’ll find failing test for your code, but that’s not even a topic of this post, you see…
I feel that you didn’t quite understand me. Functions, like checkCashRegister
have to be predictable and declarative. checkCashRegister
, for example, must output 3 things:
- Can I manage input transaction?
- If yes, the amount of change I have to give back?
- Am I able to proceed to the next transaction?
Amount (value) of change should not be dependent on OPEN/CLOSED
status because it’s not related to current transaction, but next.