I just finished coding the 4th frontend project - JS Calculator.
Everything seems to be working fine, but only 9 tests pass out of 16. I really don’t understand why.
All of them are related with the element which has an id ‘display’, maybe the problem lays there but still, no idea… Can somebody please help me ?
I think you’ve got some issues with the number 0. If the first number I click is 0 then I get “ERROR” in the display.
Also, I agree with @jenovs, these are <button>s. In order to use <div>s here you would not only need to handle the click event but also the keypress event and both Enter and Space bar would need to trigger a click. Instead of doing all that extra work, just make them <button>s.