Skip to content

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