
May 15, 2025
How I Built the Calculator (An Odin Foundations Project)
This was the final project of The Odin Project’s Foundations course, and it tied everything together — HTML, CSS, JavaScript, and DOM manipulation. The structure was straightforward: a simple calculator layout with a display and buttons for numbers, operators, clear, decimal, and equals. Using event listeners, I managed the logic for basic arithmetic operations and user input. One of the interesting parts was adding keyboard support. I had to map keyboard keys like / to their respective buttons like ÷, and ensure input chaining didn’t break the app — especially with negatives or repeated operators. I even caught and fixed a NaN+ bug caused by incomplete input. Seeing it all come together and then deploying it through GitHub Pages felt super satisfying — like building something from scratch and actually using it. Simple, but powerful!