I was browsing the internet looking for how people implement a calculator using vanilla JS, finding that many of them used the if-else ladder pattern, some of them: used a loop to add an event listener to every button, ...
This is my attempt at implementing a really simple idea, but with elegance. I'm using the partial function application pattern to evaluate expressions.
- handle unary
-