Skip to content

Ghost-Writer-2/Calculator-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculator Project 🧮

Welcome to my Calculator JavaScript practice project. We're happy to have you here 😄👀

📋 Table of Contents

👀 Project Overview

This is just a normal Calculator game made by an amatuer for practice purposes. In this project I applied everything I have learned so far which are just beginner concepts of JavaScript. I know there are better ways to approach this project and I will continue updating the project as I learn more advanced concepts. I am also willing to learn from whatever advices and obdervations you may have for me regarding this project and my learning.

🕹️ Technologies Used

  • HTML5
  • CSS3
  • JavaScript (Vanilla Js)

🔢 My Approach

  • When a button (that contains a number or simple arithmetic operator) is clicked the expression is collected and stored in the expression variable
  • This variable is then evaluated when the equal button is pressed.
  • When the backspace button is clicked, the replace() replaces the last character in the expression variable with an empty string.
  • If the eval button is clicked, expression becomes equal to result
  • Visual feedback is given (result is displayed)

📒 Techniques Applied

In this project I attempted to create a Calculator game with vanilla js as a learning project using the following concepts

  • I the || operator shorthand in place of an if statement
  • I used the eval() to evaluate expressions.
  • I used eventlisteners to run functions.
  • I used the replace() to create a backspace button.

🌩️ Problems Encountered

The drawback I am currently facing is adding a keydown event handler to the body to that will run the backspace function (del()). I will look for methods to solve this now

🐣 Areas to Improve

  • Add more functionalities like a memory to store past calculations, double display i.e display both expression and answer simultaneously on the screen.

🌱 My Appeal for Tips and Advices

I would really appreciate every tip offered on how to solve the problems I'm facing in the project. I will also appreciate tips on how I can write a more maintainable and clean code.

📱 Live Preview

About

Calculator made by an amateur. Please review and help me improve

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published