I think I just finished my calculator project. My goal with the project was to do two things: 1) learn about closures, and 2) try to emulate the behavior of a physical calculator as much as possible.
I did calculation chaining a little different from the sample project. Like a real calculator, mine gives a running total as you punch in new operations. It also allows you to repeat the last calculation by hitting the calculate button again.
I tried to keep all the calculator logic in one file (calculator.js) and all the page rendering in a second file (script.js). That plus using closures helped a lot but the code still managed to get pretty messy by the end.
I would appreciate any feedback, especially if you find any bugs-- of which i am sure there are many. Theres definitely problems with how it handles large numbers and I chose to just limit the number of digits to 9. Instead I should switch to scientific notation.
Woops almost forgot to post the link: