Javascript cal. with fcc

Tell us what’s happening:

please help!!! my user story 13 is not passing

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0.

Challenge: Build a JavaScript Calculator

Link to the challenge: this is my codepen link=>

1 Like


When I enter 8* and try replacing it with + it works but if i want to perform 8*-9 it executes 8-9 which fails the test.
Try to come up with a logic where if the earlier operator is not subtract then it should be included in the equation.
One way of doing this can be using a regex.
Hope this helps.

P.S also if I directly enter a operator at start it performs the operation with 0 which is not the right way.