Build a JavaScript Calculator-help with test case

Build a JavaScript Calculator-help with test case
0

#1

Tell us what’s happening:

I am building this app in React. While executing test pack, for test case number 10 I am getting both pass & fail. The functionality required by the test case works as expected - i.e. user is not allowed to input multiple leading zeros, so I am not sure what the issue is here. Any advice?

Link to codepen -

Error screenshot-

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/front-end-libraries-projects/build-a-javascript-calculator


#2

Hi,
I checked the Chrome Inspector and saw this error:
Uncaught ReferenceError: exit is not defined at Calculator.keyClicked (pen.js:103)

Did you remember to define a var of exit?


#3

Thanks @KoniKodes, that helped pinpoint the problem.

I had mistakenly used exit to break out of a switch statement :face_with_raised_eyebrow:

Have done the correction now and all test cases pass.


#4

That’s wonderful @mgazge

I’m looking forward to seeing what you create next.