Design comparison
SolutionDesign
Solution retrospective
When I was trying to implement the calculator functionality to mimic the iPhone calculator, I ran into a lot of difficulties in trying to implement similar functionalities, e.g.
- after one selects an operation and enters the next number, the previous result will display on the screen (accumulative)
- if one hits DEL, it clears the screen, but one can still select "=" to continue carry the most recent operation with the most recent number; however, if one hits DEL again and enters a new number and hit "=", then the same (most recent) operation (from before) will be performed on the new number. I feel like these functionalities boils down to some smart choices of states to keep track of, but I have a hard time figuring out. If you have any hints/resources-to-share, I would love to hear about them!
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord