I have a couple things I would like some help with:
I used “eval” in my code. However, I recently found out it’s not recommended to use that due to various reasons. Can anyone give me tips of an alternate method?
I noticed the TI-108 text gets pushed down slightly once the equation shows up on the screen. What’s causing this?
I would also like some feedback on how to improve this.
Don’t worry about it. The main problem with eval is that it runs arbitrary JavaScript, which is a huge problem if your app takes text input from users. Your calculator tokenizes the input by virtue of being a calculator, so aside from some completely unobservable performance issues, there’s no problem whatsoever with using eval here. Do refrain from using it any time in the future, though.
#equation has zero height until it’s filled with text, at which point it will push the text below it down.