- First I started changing the calculator by changing the style of the page
- I styled the buttons and output area
- Next I added the square root function by adding a new operation that takes the first number and brings it to the power of (1/second number)
- I also removed a line of code that was causing the operation to repeat twice
- I also made sure the operation doesn’t repeat more than one time when you press the = sign
- On top of this I made it so you can continue to use an operation and it almost acts as an equal button.
- I also fixed other errors that I found in the operation function and equal function
- Then I added keybinds to make the calculator easier to use (1-9, and operations)
- I also found an error that made the first number appear as a float, but be processed as an Integer because of the parseInt function instead of parseFloat
Creating the Calculator • 2 min read
Description
This post goes over the steps I took to modify the Calculator.