Calculator Help

Hi all,

I’m having trouble with my calculator. I can pass 15/16 tests, but am completely stumped on being able to get it to perform ONLY the last operation if more than one is entered. I’m hoping this won’t need a complete rewrite of my code, but if so, then so be it.

Here’s my codepen

This is the test I can’t pass…

Here are the requirements for the project.

Thanks in advance

Do you think you could set it up so that it will clear the state of previous operations when a new one is clicked? You may need to have a fallback of some sorts to be able to handle negative values, but that would be one approach.