Tell us what’s happening:
I have read over and over again since few days, but I don’t still understand what I’m suppose to do, not to mention writing any code.
Please help me understand the change key
, from:
=> The checkCashRegister()
function should always return an object with a status
key and a change
key.
=> 'Return {status: "INSUFFICIENT_FUNDS", change: []}
if cash-in-drawer is less than the change due, or if you cannot return the exact change’.
=> Return {status: "CLOSED", change: [...]}
with cash-in-drawer as the value for the key change
if it is equal to the change due.
Thanks in advance!
Your code so far
function checkCashRegister(price, cash, cid) {
var change;
return change;
}
checkCashRegister(19.5, 20, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
.
Challenge: Cash Register
Link to the challenge: