hey guys i am working on the “Build a JavaScript Calculator” project in the “front end libraries” certification and am nearly passing all tests but I have a few that are failing.
my codepen is here: https://codepen.io/notcode5/pen/WNwOJoX
as you can see, four tests are not passing. those are 7, 10, 11, and 13.
10, 11, and 13 are all related and basically is the same general error. and that is just where it says that if it has multiple decimal points (test 11), multiple zeros at start of a number (test 10), or multiple consecutive operators (test 13), the code should automatically not accept it.
I don’t know how to make it to where the code does not accept these three things so any help on this would be appreciated.
ALSO, dont forget about good ol test number 7! test 7 is unrelated to the three aforementioned tests and is completely its own thing. test 7 just says that when the clear button is pressed, it should clear all the input and output values (which it does) but the reason why test 7 fails is because even though the clear button does its job, IT DOESN’T SHOW 0 IN THE DISPLAY ON PRESS.
so yeah, it clears the values but it doesn’t show zero in the resetted display. instead it just shows nothing in the display (aka a blank display). this little extra detail in test 7 is a real hassle and annoyance and i feel that it is negligible but I guess I have to do it to pass the test (honestly I like it better blank, instead of the zero like in most calculators)
so again, any help on this issue (test 7) would be appreciated also.
And that is it! All other tests are passing as of now, 12 out of 16. which is pretty good tbh, the calculator works otherwise, just these little details are preventing me from moving on.
thanks!