Javascript Calculator user story 13 issue

I have tried too much to pass this user story. I want some help or tips to help me pass this user story.

My project link so far

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0

Challenge: Build a JavaScript Calculator

Link to the challenge:

Regarding test 13, you get the error message:
“The sequence “5 * - + 5” = should produce an output of “10” : expected ‘-25’ to equal ‘10’ "
This is referring to user story #13: " If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative ( - ) sign).”
Therefore, for the sequence “5 * - + 5” should end up being computed as “5 + 5” as the the previous operands will be overwritten/ignored.
I haven’t looked through all your code, but it doesn’t appear as if you have any logic to cover this.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.