Tell us what’s happening:
I’ve finished my JS calculator and everything is working as intended, however I’m failing more than half the test on a technicality. For some reason, my button and display elements have a \n character at the end of them, but I’m not sure which part of my code is adding those new lines in. So, I’m getting errors like "expected '=\n' to equal '='" for my #equals button, and the same for my #display, #decimal, etc. How can I avoid this \n being added in?
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.
I actually don’t really know the assignment but i do have a question, how is it supposed to handle chaining? If i do 4 + 5 * 2 should it not do (4 + 5) * 2 and not 4 + (5 * 2).
Weird, I get only 6/16 test passed and all the failed tests are due to the \n being added.
As for the chaining, the challenge itself actually mentions that there are two ways to implement calculator logic, called immediate execution logic and formula logic. The example given uses the same logic as my implementation, which is formula logic.
I just tried it in Microsoft Edge and all the tests are passing, miraculously. This is a really weird issue. If anyone manages to figure out what’s going on here, please let me know.
Edit: Working fine in the latest version of Firefox as well.