Calculator help, before I throw it out the window!

I’m close to throwing my Calculator out of the window (even if it means relinquishing myself of a desktop PC)!

Could somebody have a look at my code and give me some hints as to how I pass the final test? It needs to manage the operators so that the last one entered is the one that is used, apart from the blasted ‘-’ sign!!

I’ve literally been looking at it for hours and have tried numerous solutions, which end up tying me in knots.

Thanks in advance!

(ps I’ve kept the h1 placeholders for my state at the moment as it helps me to track it)

Panic over, my desktop PC survived and the calculator is now fully functioning. A little bit of Regex magic appeared to do the trick by replacing the old operators with the new!



And you solved it on your own!

I do have to warn you that “Pomodoro Clock” still gives me nightmares. And I needed a new PC anyways so I’m over it. Backup your data about halfway in :slight_smile:

Happy coding


I’m looking over the spec for the Pomodoro Clock now and it’s already giving me heart palpitations!

Making it “work” isn’t to bad, easier then the calculator in my experience. Less buttons = easier? right … but getting it to “working” is a nightmare.

It will look like it’s working but test will say no. I won’t spoil the fun for you, but invest in some posters to cover the holes in the wall if your experience goes like mine :rofl:

We’ll be here to help, but in the end the struggle helps 1000% in learning.

And if you get stuck, someone here will hopefully give you a slight hint without spoiling it all!

Good luck!