Javascript calculator for everyday use with basic functions and more!

Project inspired by The Odin Project Javascript Foundations course.

calculator project image

Live preview

Build with

  • HTML & CSS
  • CSS Flexbox
  • Vanilla Javascript

What I learned

  • Math methods
  • Writing coherent code
  • Reusing functions
  • Keyboard support

Project features

  • 10 possible actions for doing calculations on numbers
    • Add, substract, multiply, divide
    • Power (x^y), root (x => y)
    • Factorial
    • Pi number
    • Modulo operation
    • Changing sign (+/-)
  • Clearing all and deleting last digit
  • Decimal point included
  • Keyboard support (+numpad)
  • Responsive on all screens
  • Chaining calculations
    • by pressing double operator (do previous calculation on new number)
    • by remembering last result and do new calculation on it
  • Exponential numbers with Euler’s number

To do

  • Memory function known from calculators (M / +M)
  • Add logic for programmer mode functions (cos/sin/tg/ctg etc.)


View Github