I’m currently working on My Calculator Project, but it’s not passing test #7. But reading the requirements for test #7, my calculator does what it asks. I’m not sure what piece I’m missing here.
And yes, the calculator is not complete, so I’m not concerned about the equals not working, etc. I’m only concerned about test #7 currently.
I have my button clicks being handled by a switch statement. Here is the chunk that’s producing what feels like a working solution.
I know this is a problem area, but even changing my switch statement to reset readoutDisplay to 0, effectively setting both divs to 0, has no effect. The test still fails.
Yeah, that’s what I was mentioning above. That makes sense but didn’t fit the behavior I wanted for my calc. Either way, changing the readout to 0 as well has no effect. The test still fails. I will update the repo with that effect if it helps.
I saw this post some time ago but the forum had log in issues at the time so I was not able to reply.
If I remember correctly I fixed it by changing the key value on the Button component to just use the id (i.id) instead of Math.random(). I have not re-tested this again.
Edit: some clarification, i mean in the map inside the App component
I have made this change but I have issues with my expression evaluation which is now preventing the tests from even fully running. So in that regard, this specific problem may be fixed - I’m just not sure. Still working/struggling on it.
I completely removed the expression parser that I had implemented and it now passes 11 tests. I’m still not entirely sure what the problem was, but as far as this thread is concerned, I guess it’s “solved”. Thanks for all the help.