Please help register program

Tell us what’s happening:
im so fustrated i cant find what im doing wrong im about to just erase it all and start from scratch again can anyone please help me take a look…

Your code so far


// VALUE IS IN PENNIES TO AVOID ROUNDING ERRORS.
const BILLS = [
["ONE HUNDRED", 10000],
["TWENTY", 2000],
["TEN", 1000],
["FIVE", 500],
["ONE", 100],
["QUARTER", 25],
["DIME", 10],
["NICKEL", 5],
["PENNY", 1],
];

// RETURNS TRUE IF THEIRS CORRECT CHANGE FOR BILL IN CASH DRAW
function iHaveChange (billsValue, myBILLSchange, requiredChange) {
return myBILLSchange >= billsValue && requiredChange - billsValue >= 0;
}

function iHaveNoBILLS (myCash) {
let iHaveChange = false;
Object.keys(myCash).forEach(key => {
  if (myCash[key] > 0) {
    iHaveChange = true;
  }
});
return iHaveChange;
}

// CONVERTS ["PENNY", 1.01] TO ["PENNY", 101]
function cidToObject (cid) {
const myCash = {};
cid.forEach(money => {
  myCash[money[0]] = parseInt(money[1] * 100);
});
return myCash;
}

// RETURNS CORRECT CHANGE FOR GIVEN PURCHASE
function checkCashRegister (price, cash, cid) {
let requiredChange = cash * 100 - price * 100;
let myCash = cidToObject(cid);
let clientCash = {};
let i = 0;

// NO CHANGE? DONE.
if (requiredChange === 0) {
  return {
    status: "CLOSED",
    change: cid
  };
}

// GIVE CHANGE IN DESCENDING ORDER FROM BIG -> TO SMALL BILLS
while(i < BILLS.length && requiredChange > 0) {
  let billName = BILLS[i][0];
  let billValue = BILLS[i][1];

  if (iHaveChange(billValue, myCash[billName], requiredChange)) { 
    clientCash[billName] = 0;

    while(iHaveChange(billValue, myCash[billName], requiredChange)) {
      clientCash[billName] += billValue / 100;
      myCash[billName] = parseInt(myCash[billName] - billValue);
      requiredChange -= billValue;
    }
  }
  i++;
}

// HANDLE RETURNS OBJECT 
if (requiredChange === 0) {
  if (iHaveNoBILLS(myCash)) {
    return {
      status: "CLOSED",
      change: cid
    };
  }
  return {
   status: "OPEN",
   change: Object.keys(clientCash).map(key => {
   let arr = [key, clientCash[key]];
   return arr;
   })}; 
}
return {
 status: "INSUFFICIENT_FUNDS",
 change: []
 };
}  

checkCashRegister(19.5, 20, [["PENNY", 0.5], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36 OPR/66.0.3515.72 (Edition Campaign 34).

Challenge: Cash Register

Link to the challenge:

I can’t do a deep debugging at the moment, can you add more infos on what’s not working?
what are the outputs, what should they be?
do you add any console.log and see something not expected happening?

I found the Solution I had been racking my brain for month I put it up and came back to it and finally saw my mistake. I used console.log and I was getting a object but it wouldn’t say open or close. If you look at the code on the first return line I had forgotten to put a " ! " mark in front of “iHaveChange”. I felt so dumb cause i look at that line and couldn’t put my finger on it so many times.
Thanks for the help again Chou’ Nena…