I recently finished my first main project with javascript with this calculator. I decided to include a saved history of inputs which provided an interesting challenge.
I was wondering what you guys thought about how I organised my javascript code and if you found any bugs.
Hey @Chalkhous, it looks really great, nice work! Unfortunately, almost every case I thought might produce a bug was positive. I think it’s a good example of difference between MVP/prototype and production-level page/app. It’s relatively easy project and most importantly it involves numbers, so I would suggest you to challenge yourself even further and try to polish it to a production-level thing, believe me you will learn A LOT and will be amazed how much more work shall be done here! Knowing how to deal with numbers is a good skill!
Let me know if you’d like to go further with the challenge and I’ll suggest you couple tests you shall complete for your calculator!
Hey, thanks for the feedback! Could you give a few examples of the bugs you found? I tried my best to get rid of them so I’m not sure on the best way to test it.
I’ll separate test cases to families and will go from most popular to least popular (and I won’t include those that you covered) 1. Edge cases
1A. How do deal with limit of digits on the screen?
99999999999 + 1 should be equal to 100000000000
10000000000 - 0.125 should be equal to 9999999999.875
1B. Do you allow unlimited chain of operations? If yes, how are you going to represent it in history?
Thanks for taking your time to write all that up! I don’t think I would have thought of any of those cases.
Is 3b necessarily wrong though with 2 / 0 = infinity?