/calculator-app

Calculator app built using HTML, CSS and JS.

Primary LanguageJavaScript

calculator-app

Calculator app built using HTML, CSS and JS. From the Odin Project Curriclum.

Functionality

  • This calculator can execute operations up to 14 digits. If a resulting number is greater, an "ERROR" message will be displayed.
  • Operators("/", "*", "-", "+")
  • Special buttons("All Clear", "Delete", "+/-", ".")
  • An empty display will always show 0
  • Button clicks represented using CSS
  • Calculator evalutates numbers in pairs and changes display to result.
  • Operators can be used instead of "=" to execute an operation and queue the next operator

Thoughts

This project took the longest to complete. The main reason being my lack of planning at the start. In hindsight I should have written down how I was going to build each component, and what problems I needed to solve. This project has shown me the importance of having a clear vision from the start, and outlining my ideas before implementing them.

I improved my problem solving skills. When I encountered an operation that did not work, or was producing the wrong result

  • I used console.log() to log variables to the console to see if they contained the correct value. Or to narrow down what section of code was not working.
  • Testing incrementally.
  • Using StackOverflow helped me understand how to articulate the problem.
  • Using Chrome Devtools

The operate and addOperator functions both work but are fairly convoluted. Writing clearer and more efficient code, is something I need to improve on through reading professional developers code and practise.