Test won't pass - JS calculator

I keep getting an error while trying to pass #13 user story: SyntaxError: invalid increment/decrement operand.
My code
What’s wrong with my code? :thinking:

The first part of that error messages says:

“If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative (-) sign.”

Have you tried to implement this requirement in your code? If so, please give us the line number(s) of where you are accounting for this.

1 Like

Looking at the error and poking at your code shows that you can enter a formula with multiple operands like 9++9 and 4*+8. The requirements of the test ask that you only allow the last “-” operator to stay - signifying a negative number.

I don’t have an exact answer for you, but I would look in that direction.

1 Like

Thanks, I found out what the problem was and fixed it! :grinning: