About this site

Main

ES EN

Calculadora

About this project

It has certainly been a while since I've touched Javascript, and I wanted to regain some of the know-how I had about it, that's why decided to code this calculator from scratch without using any external libraries, nor chatbots, only wikis like w3 school about the language itself even if that required more time.

So it began my learning journey, coding this entire calculator has been quite a joy I must say, and even if the final product is lacking some funcionality like parenthesis parsing it still works completely fine for most things, as it process inputs using PEMDAS.

Were I to make it all over again, I would probably go about things differently, researching about more efficient algorithms and methods and not reinventing the wheel, but the thing is, that's the entire point of this excersice, wasn't for that self-impossed limitation, I could make use of tons of more efficient libraries.

Now about the inner workings of the script, I implemented a simple array that stores every character typed, and once the equal key is pressed, it sends the array to be processed in the following steps: Concatenate the digits, from [1,1,'+',2,3] to [11,'+',23]. Search for term separators, and create multidimensional arrays with each level representing one type of operation. Undo all this array but backwards, processing the output as it goes. It looks easy on paper, but I spent an entire day and a half coding and dealing with each aspect of programming, things I didn't quite remember, others I didn't know from the get-go, etc. (I must add a personal rant about how difficult is dealing with multidimensional arrays, it's not a trivial task for sure).

Update 23/01/2026
I showed my calculator to a friend of mine and they pointed out I was lacking a 0 button, how could I miss that, seriously XD.

Entirely handmade, css & html only (and some js here) :D

Rainbow cable.

Version 1.0.4, 23.01.2026