Build a Cash Register Project - Build a Cash Register

Tell us what’s happening:

Test is not accepting the last one, even though it is fulfilling the criteria. All other tests are succeeding but only this one is failing. Here is the code for my displaying the results

Your code so far

function displayChange(arr) {
    if (getTotalCID() <= 0) {
        changeDueDiv.innerHTML = `
        <p class="status-p">Status: <span class="status-span">CLOSED</span></p>`;
    } else {
        changeDueDiv.innerHTML = `
        <p class="status-p">Status: <span class="status-span">OPEN</span></p>`;
    }
    arr.forEach((value, index) => {
        if (value || index > 4) {
            changeDueDiv.innerHTML += `
            <p class="status-p">${cid[index][0]}: <span class="status-span">$${value}</span></p>
            `
        }
    });
}

Challenge Information:

Build a Cash Register Project - Build a Cash Register

Last test has a bug, you can see details at:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.