Skip to content

lazarchuk-v/Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👋 Hello and welcome to my GitHub repository!

I am a JavaScript developer seeking a new opportunity. This repository showcases my skills and experience in writing clean, efficient, and well-documented code.

🧮 Project: Calculator

https://specvova-calc.netlify.app

The calculator project is a simple calculator that performs basic arithmetic operations. The calculator has a screen and a set of buttons that trigger the calculation when clicked. The code is written in JavaScript and uses the DOM API to interact with the HTML elements of the calculator.

☝️ Key Features

  • The calculator can perform basic arithmetic operations such as addition, subtraction, multiplication, and division.
  • The "CLEAR" button allows the user to clear the calculation and start a new one.
  • The "=" button evaluates the current calculation and displays the result on the screen.
  • The code includes error handling for cases where the calculation exceeds the 10-digit limit of the calculator's screen.

The code starts by selecting all buttons and the screen display using the DOM API's querySelectorAll and querySelector methods, respectively.

The calculate function is called when a button is clicked. The value of the clicked button is passed as an argument to the function. The function checks the value of the button and performs the appropriate action. If the value is "CLEAR", the calculation is reset and the screen is cleared. If the value is "=", the calculation is evaluated using the eval function and the result is displayed on the screen. If the calculation exceeds the 10-digit limit of the screen, an error message is logged to the console.

Finally, an event listener is added to each button to trigger the calculate function when the button is clicked.

📑 Conclusion

This code provides a basic implementation of a calculator in JavaScript. It demonstrates my skills in using the DOM API to interact with HTML elements, handling user input, and writing clean, efficient, and well-documented code. I am confident that my skills and experience will enable me to tackle more complex projects and contribute to the development of successful applications.

If you have any questions or would like to discuss any opportunities, please don't hesitate to reach out to me. I look forward to hearing from you!

Thank you for taking the time to review my repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published