I am trying to create a calculator.
My problem is the buttons could be double clicked creating 2 of the same characters next to each other (Example: 2++2). I want to remove the second plus sign.
So far I've managed to use this:
if(!y.includes("+")) {
summed.push("+")
document.getElementById("num").innerHTML = summed.join('')
}
But this will only allow 1 plus sign and would disable any other. My intended solution should be this (3+3+3) and not this (3++3). Hopefully this is understandable.