Hi, I’m trying to follow a tutorial on building a calculator, mainly to understand the logic for my own react/redux project. The tutorial is here https://www.freecodecamp.org/news/how-to-build-an-html-calculator-app-from-scratch-using-javascript-4454b8714b98/ I’m only to the “happy path” where the user hits a number key. What I’m trying to accomplish is to check if the display is 0,and if so, take the key pressed and put it in the display instead. Only working with a single digit for simplicity’s sake at the moment.
The issue I cannot solve is that it keeps showing an error with textContent, but only when i refer to the display element. When i tell it to get the textContent of a key it seems to work perfectly fine, but when I tell it to get what is on my display I run into this error. After much googling where I can’t make heads or tails of the responses on various stackoverflow or github posts, I’ve come to the forum for help. Can anyone tell me what’s going on?
the pen is below:
https://codepen.io/seth-alan-burleson/pen/poEjdLj?editors=1010