Calculator calculation error

Hello ladies and gentlemen

here is the link https://codepen.io/zootechdrum/pen/pxWYLL?editors=1011

I am having trouble coming up with a setting up the display for a sequence like the one below

5/5*4

my calculator appends the number to the solution instead of replacing what is on the display and starting fresh.

Spent a while trying to debug but couldn’t figure it out sorry.

Focusing on having pure functions that don’t mutate variables outside of their scope can make code less error prone, easier to debug, and more readable as you can test each function individually.

I found another bug?

Try 8/4 = /2 =.

That should give a valid result but produces NaN.

1 Like

damn it!!! yeah I thought i fixed it but no good. It seems to only happen in division and multiplication operation but why???