Challenge in javascript, cant find errors

Hi everybody, here is the request of the challenge:
Design a cash register drawer function checkCashRegister() that accepts purchase price as the first argument ( price ), payment as the second argument ( cash ), and cash-in-drawer ( cid ) as the third argument.

cid is a 2D array listing available currency.

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.

Otherwise, return {status: "OPEN", change: [...]} , with the change due in coins and bills, sorted in highest to lowest order, as the value of the change key.
Here is my code, please give me some help, thank you <3

let array = [["ONE HUNDRED", 100],["TWENTY", 20],["TEN", 10],["FIVE", 5],["ONE", 1],["QUARTER", 0.25],["DIME", 0.1],["NICKEL", 0.05],["PENNY", 0.01]];

function checkCashRegister(price, cash, cid) {

   let resto = cash - price;

   ratio100 = resto / 100;

   pezzi100 = parseInt(ratio100) * 100;

   resto20 = resto - pezzi100;

   ratio20= resto20 / 20;

   pezzi20 = parseInt(pezzi20) * 20;

   resto10 = resto - pezzi100 - pezzi20;

   ratio10 = resto10 / 10;

   pezzi10 = parseInt(ratio10) * 10;

   resto5 = resto - resto100 - resto20 - resto10;

   ratio5 = resto5 / 5;

   pezzi5 = parseInt(ratio5) * 5;

   resto1 = resto - resto100 - resto20 - resto10 - resto5;

   ratio1 = resto1 / 1;

   pezzi1 = parseInt(ratio1) * 1;

   resto025 = resto - resto100 - resto20 - resto10 - resto5 - resto1;

   ratio025 = resto025 / 0.25;

   pezzi025 = parseInt(ratio025) * 0.25

   resto01 = resto - resto100 - resto20 - resto10 - resto5 - resto1 - resto025;

   ratio01 = resto01 / 0.1;

   pezzi01 = parseInt(ratio01) * 0.1

   resto005 = resto - resto100 - resto20 - resto10 - resto5 - resto1 - resto025 - resto01;

   ratio005 = resto005 / 0.05;

   pezzi005 = parseInt(ratio005) * 0.05;

   resto001 = resto - resto100 - resto20 - resto10 - resto5 - resto1 - resto025 - resto01 - resto005;

   ratio001 = resto001 / 0.01;

   pezzi001 = parseInt(ratio001) * 0.01;

  

    if (price = cash) {

       var firstObj = { status: "CLOSED", change: cid}

       return firstObj

   }

   else {

      for(let i = 0; i < cid.length; i++) {

        for (let j =0; j < cid[i].length; j++) {

          var sommaCassa = reduce(cid[j])

           for ( sommaCassa > resto && cash < price) {

               array[i].pop()

               array[0].push(pezzi100)

               array[1].push(pezzi20)

               array[2].push(pezzi10)

               array[3].push(pezzi5)

               array[4].push(pezzi1)

               array[5].push(pezzi025)

               array[6].push(pezzi01)

               array[7].push(pezzi005)

               array[8].push(pezzi001)

               var secondObj = { status: "OPEN", change: array }

                return secondObj;

            }

          for (sommaCassa < resto) {

             var terzoObj = {status: "CLOSED", change: cid}

             return terzoObj;

          }

        }

  

   }}}