Js Calculator - Ugly - Breaking test 13

So my ugly version is breaking test 12 for the Javascript Calculator and I am not sure why :

I would appreciate some help.

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Get Help > Ask for Help button located on the challenge.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like

Can you provide a link to the project requirements?

If I press 1+-1= I get the answer 2 but I believe it should be 0 (1-1)

If I press 1+-+1= I get the answer NaN but it should be 2 (1+1)

Does this help, or you want to know why it acts this way?

Here we go : https://www.freecodecamp.org/learn/front-end-development-libraries/front-end-development-libraries-projects/build-a-javascript-calculator

Explanation of why it acts like that would be appreciated.

What have you tried to figure out what’s happening?