0

React Calculator issue with "-"

So i have this calculator, for the freecodecamp exercice. Everything works except one test case. When i press more than 1 operator consecutively, the operation performed should be the last one entered, except for -. That exception messes up my test case. I have no idea how to fix it. Help I attempted something with a "negative" variable, but I had no success. https://codepen.io/AlexTAG/pen/YzgdGoX?editors=0011

15th Feb 2024, 11:46 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
2 Respuestas
+ 1
Could you create an if else which checks the -(minus) operation
15th Feb 2024, 3:32 PM
Ausgrindtube
Ausgrindtube - avatar
0
I can, but the issue is, what do i actually check ?
15th Feb 2024, 5:10 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar