Issue with Javascript Calculator, tests 9 and 13 mutually exclusive

I have an issue with the Javascript calculator project, specifically on issue 9. Currently, my calculator supports calculations with negative numbers by making it so that if a negative number is pressed with said intent, it uses negator and calculates accordingly so that negative numbers can be calculated.

However, to concatenate functions so that test 9 passes, I’m required to calculate after each button press. Basically, I can either pass test 9, or 13, but never both. I would appreciate any help, I am not exaggerating when I mean I’ve spent over 8 hours trying to debug this and I’m losing my mind.

  • Yes, I’ve attempted string concatenation and eval three times, no it does not work long term unless I want to completely rewrite the code logic.
  • I’ve already asked to StackOverflow, I was only told “use eval” and nothing else.
  • I’ve already looked through the other issue cases in this Forum, none aid.

Link to my code pen is here: https://codepen.io/DanitzaFuenzalida/pen/BaXKrKZ?editors=1111

hello and welcome to fcc forum :slight_smile:

adding “fcc test checker plugin” in codepen project would be helpful to see that in action for ourselves, thanks.

  • can you elaborate on this? how do you intent to rewrite existing codebase that might resolve this issue?

include snippet where exactly are those two “usecases” are responsible for them.

happy coding :slight_smile:

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