Skip to content

rue-eru/js-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Vite CSS3 JavaScript Calculator

JavaScript Calculator

An old project built in the first half of 2025 as the start of my journey and posted here to attach to the course's page and to preserve my path.

This project is a part of FreeCodeCamp's Front End Development Libraries Certification. The goal is to build a JavaScript Calculator that allows users to do simple arithmetic calculations.

📋 Project Requirements

This project fulfills all 15 user stories from FreeCodeCamp's "Build a JavaScript Calculator" challenge:

Click to expand the full requirements

User Stories:

  • Clickable = element with id="equals"
  • 10 clickable number elements (0-9) with IDs: id="zero" through id="nine"
  • 4 clickable operator elements with IDs: id="add", id="subtract", id="multiply", id="divide"
  • Clickable decimal element with id="decimal"
  • Clickable clear element with id="clear"
  • Display element with id="display"
  • Clear button resets calculator to initialized state (shows 0)
  • Input is visible in #display as numbers are entered
  • Can add, subtract, multiply, divide chain of numbers — = shows correct result
  • Numbers cannot begin with multiple zeros
  • Decimal appends . to current value; two decimals in one number not allowed
  • Operations work on numbers containing decimal points
  • Consecutive operators: last operator entered is used (excluding negative sign)
  • Operator immediately after = starts new calculation on previous result
  • Reasonable decimal precision (handles 2 / 7 to at least 4 decimal places)

All tests passed

🎨 About the Project

Technologies Used

  • Frontend: React, Vite, CSS
  • Build Tool: Vite
  • Deployment: GitHub Pages
JavaScript Calculator Preview
JavaScript Calculator Demo
submitted to FreeCodeCamp on Mar 4, 2025

🔗 Live Demo

Live Demo


Fourth project of my FreeCodeCamp Front End Libraries Certificate journey
Certificate

Contributors