0
How to prevent multiple operands in javascript calculator?
Eg: 2++2, when i press "+" more than one time consecutively it should not add another plus sign. below is my code of calculator https://code.sololearn.com/WZMx7gAFYd1M/?ref=app
1 Answer
+ 12
if (!input.endsWith(op)) {
input += op
}
//like that...