Loading repository data…
Loading repository data…
Beans4u / repository
Calculator web-app built from scratch using JavaScript, CSS, and HTML as part of The Odin Project's open-source curriculum
A browser-based calculator built with vanilla JavaScript, HTML, and CSS as part of The Odin Project Foundations curriculum.
The goal of this project was to take the core concepts from Foundations and combine them into a complete interactive application, focusing on DOM manipulation, state management, user input handling, and application logic without relying on external libraries or eval().
This project started as a simple calculator assignment, but quickly became an exercise in managing application state and user interaction cleanly.
Some of the main areas of focus included:
eval()The calculator uses a lightweight finite state machine (FSM)-style approach to keep input flow predictable and avoid ambiguous calculator behaviour.
12 + 7 - 3)0.5 instead of .5)Rather than parsing full mathematical expressions, the calculator evaluates operations step-by-step using explicit state management.
The application moves between a small set of controlled states:
IDLEOPERAND1_ACTIVEOPERAND2_WAITOPERAND2_ACTIVERESULTKeeping the calculator state explicit helped simplify input handling and made debugging much easier as more edge cases appeared during development.
operate() routes calculations based on the selected operatorDESIGN.md
MVP planning, assignment constraints
DEV_LOG.md
Development notes, implementation & debugging checklists
LOGIC_NOTES.md
Calculator logic, state transitions, source code documentation
No frameworks or external dependencies were used.
This project was mainly an opportunity to get more comfortable with:
I completed the MVP for this assignment. Future improvements can include:
Built for the calculator project from The Odin Project: Foundations open-source curriculum.