When I click the buttons the screen is not displaying anything
17:12 29 Sep 2022

I'm creating a calculator app in vanilla JavaScript everything was working just fine but when I click the different calculator buttons nothing is being rendered to my screen and I don't get where the problem is. This is my JavaScript code:

let runningTotal = 0;
let buffer = "0";
let previousOperator;**strong text**
const screen = document.querySelector(".screen");

function buttonClick(value) {
 if (isNaN(parseInt(value))) {
     handleSymbol(value);
 } else {
     handleNumber(value);
 }
 rerender();
}

function handleNumber(value) {
 if (buffer === "0") {
     buffer = value;
 } else {
     buffer += value;
 }
}

function handleMath(value) {
 if (buffer === "0") {
     // do nothing
     return;
 }

 const intBuffer = parseInt(buffer);
 if (runningTotal === 0) {
     runningTotal = intBuffer;
 } else {
     flushOperation(intBuffer);
 }

 previousOperator = value;

 buffer = "0";
}

function flushOperation(intBuffer) {
 if (previousOperator === "+") {
     runningTotal += intBuffer;
 } else if (previousOperator === "-") {
     runningTotal -= intBuffer;
 } else if (previousOperator === "×") {
     runningTotal *= intBuffer;
 } else {
     runningTotal /= intBuffer;
 }
}

function handleSymbol(value) {
 switch (value) {
     case "C":
         buffer = "0";
         runningTotal = 0;
         break;
     case "=":
         if (previousOperator === null) {
             // need two numbers to do math
             return;
         }
         flushOperation(parseInt(buffer));
         previousOperator = null;
         buffer = +runningTotal;
         runningTotal = 0;
         break;
     case "←":
         if (buffer.length === 1) {
             buffer = "0";
         } else {
             buffer = buffer.substring(0, buffer.length - 1);
         }
         break;
     case "+":
     case "-":
     case "×":
     case "÷":
         handleMath(value);
         break;
 }
}

function rerender() {
 screen.innerText = buffer;
}

function init() {
 document
     .querySelector(".calc-buttons")
     .addEventListener("click", function (event) {
         buttonClick(event.target.innerText);
     });
}

init();

When I click my buttons they are not being rendered on the screen as expected even though I have included a rerender() function on the function that handles click events.

javascript html css function