Skip to content

Simple calculator, supporting basic operations such as add, subtract, multiply, divide

Notifications You must be signed in to change notification settings

emilielydiat/calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🧮 Calculator

About the project

Simple browser calculator app, allowing user to add, subtract, multiply and divide numbers using the provided UI.
Created as part of The odin Project Web Development Foundations curriculum.

Live demo 👀

Features

  • Multiple operations supported: add, subtract, multiply, divide
  • Decimal inputs supported
  • Results rounded to three decimal places
  • Clear button for user to start over
  • Back to back calculations supported
  • Error message when trying to divide by 0

Built with

🪄 Technologies

  • JS
  • CSS
  • HTML

🔧 Tools

  • Visual Studio Code
  • Git & GitHub
  • macOS Terminal

💙 Credits

  • Referred to michalosman's project to understand the logic of the user interaction with the calculator, and figure out potential bug scenarios in order to prevent them

Takeaways

  • Learned basics of regex (regular expressions) and how to use them in conditional statements (e.g. if (/[0-9.]/.test(char) {...} )
  • Practiced Math.round() method
  • Practiced printing variables' values in DOM elements
  • Practiced event listeners with button click events
  • Practiced CSS Grid & CSS Flexbox
  • Practiced BEM naming convention for CSS classes