Build a Calculator App in HTML, CSS & JavaScript 2022 by Tyler Potts
Tyler's video caught my eye as a quick fun exercise to try out a few things, but I ended up spending quite a bit of time on it and taking things a bit further.
Amongst other things, I did some restyling and refined the input/output formatting.
I went down the rabbit hole hammering out input validation and refining other parts of the logic.
There were some tricky problems like how to support negative numbers without adding a +/- key, and catching edge cases like infinity and numbers expressed with exponential notation.
JavaScript can do a pretty bad job of evaluating some expressions.
e.g.
- .3 x 10 = 3
- .3 ÷ .1 = 2.9999999999999996
YouTube video: Build a Calculator App in HTML, CSS & JavaScript 2022 by Tyler Potts
Background art by Dan Cristian Pădureț
Calculator favicon from icons8.com
YouTube icon from iconfinder.com
Applause icon from icons8.com