In this calculator app below, the displayNum textContent (line 25)only displays one number after I hit an operator button
#textContent problem
2 messages · Page 1 of 1 (latest)
You set calculator.dataset.previousKeyType = 'operator' when you press an operator but you never reset it anything else when you press a number button... so once it's set to operator is STAYS that way...
So now when you check the previousKeyType on line 31 you check if it's an "operator" however this is set at line 26 to be the calcualte.dataset.previousKeyType... Oops... once it's an "operator" it stays there...