Last project of javascript: Please help me understandig this project

Tell us what’s happening:
I read the instruction and hints. But I did not understanding this project.
What should I do ? What the project is telling us to do?
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 (Macintosh; Intel Mac OS X 10.16; rv:85.0) Gecko/20100101 Firefox/85.0.

Challenge: Cash Register

Link to the challenge:

it is asking you to similate a cash register transaction:
the inputs are the value of the transaction, and what the client is paying, you need to calculate the change to give back, and in what denominations (if possible) based on the content of the cash register

Tell us what’s happening:
What should I do with my code to return {status: "OPEN", change: [...]}
What methods, functions, ways should I do or take to achieve this challenge?
Your code so far


let currencyUnit = [
 { name: "ONE HUNDRED", val: 100.0 },
 { name: "TWENTY", val: 20.0 },
 { name: "TEN", val: 10.0 },
 { name: "FIVE", val: 5.0 },
 { name: "ONE", val: 1.0 },
 { name: "QUARTER", val: 0.25 },
 { name: "DIME", val: 0.1 },
 { name: "NICKEL", val: 0.05 },
 { name: "PENNY", val: 0.01 }
]

function checkCashRegister(price, cash, cid) {
var output = { status: null, change: [] };
 var change = cash - price;

 let transformCID = cid.reduce(
   function (acc, cur) {
     acc.total += cur[1];
     acc[[cur[0]]] = cur[1]
     return acc;
   } ,
   {total: 0}
 );

if (transformCID.total < change) {
  output.status = "INSUFFICIENT_FUNDS";
  return output;
}

if (transformCID.total === change) {
   output.status = "CLOSED";
   output.change = cid;
   return output;
 }
  
  return output;
}

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


// First, create an array of objects with the value of each denomination of bill or coin, along with an output object with the status and change keys. Next, transform the CID array into a drawer object. Then, handle the conditions of exact change and insufficient funds. Loop through the denom array and update the change and values while there is still money of each type in the drawer and while the denomination is larger than the change remaining. Add this denomination to the accumulator of change_arr if any of this type was used. After the loop, change_arr is a 2D array of the change due, sorted from highest to lowest denomination. If there are no elements in change_arr or you still owe change, return the output object with a status of INSUFFICIENT_FUNDS. Finally you can give the correct change. Return the output object with a status of OPEN and change_arr as the value of change.
   **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:85.0) Gecko/20100101 Firefox/85.0.

Challenge: Cash Register

Link to the challenge: