Bug on project Calculator

Bug on project Calculator



I am working on the Calculator Project and i am stuck on user story where you need to add multiple operating signs until you click equals.

User Story: I can keep chaining mathematical operations together until I hit the equal button, and the calculator will tell me the correct output.

Can you help me figure this out. Here is the project, feel free to give me any suggestions on my code so far.


I already have done two unsuccessful attempts that are commented

//This is my attemp to solve the problem 7-6+2


This is going to take a bit of a paradigm shift on how the calculations are done… It will only take the first num, operator, second num and return that result based on those if statements…

What I would try is something along the lines of catching the numbers + operators without doing the calculations that way and return and eval of the display output. Just be careful with how the operators return, be sure to check the console log and see if they come in right… 7-6+2-5+6 will run but 7"-“6”+"2… etc wont!