Javascript/React Calculator feedback

Hello everyone,

So I completed the calculator final project on and am fairly satisfied with it. However, I’m sure there were better ways to write my code more succinctly. I tried to keep it all annotated for readability. If anyone would be willing to take a look and let me know if there are ways I could improve the code that would be nice. In general, I’m looking for the code to achieve some kind of professionalism, but not necessarily perfection.

Thanks in advance,

multiple decimals can be seen in the display if I calculate a number that has a decimal then use a decimal again. If I do any calc with that broken number the app will crash.


0.5 + 0.1 = 0.6

.0.6.1 + 1 = crash

Not sure why you are putting decimal count in state, why not just check if the string contains a character?


Thanks for that little bit of debugging. I think I’ll leave it as it is as it’s nothing major :slight_smile:

good idea with the checking bit