Skip to content

ClarityOfMind/calculator

Repository files navigation

Javascript web calculator

Performs simple calculations as well as advanced ones as exponent, rooting, nth rooting, factorization, calculation a logarithm.

⚠ Warning! This app works stable with Google Chrome only.

Local installation

  1. Clone this repo to your local machine
git clone https://github.com/ClarityOfMind/lecture_09.git
  1. Start up local static server
npm run start

Development installation

  1. Clone this repo to your local machine
git clone https://github.com/ClarityOfMind/lecture_09.git
  1. Go to the project's root directory

  2. Run

docker-compose up
  1. Open your browser on "localhost:8080" to observe the app.

Design patterns used

  1. Decorator
src/js/index.js   // line 5,6
  1. Memoization
src/js/calculator/core/calculations.js   // line 34
  1. Composite
src/js/calculator/calculator.js   // line 12
  1. Observer
src/js/calculator/calculator.js   // line 11

ES6 features used

  1. Class
To reach module approach and make apllication's expansion fast and easy.
  1. Const
To ensure immutability of data assigned to variables.
  1. Let
To limit variables' scope.
  1. Arrow function
Use as a callback function to make parent's function context available.
  1. Destructuring assignment
syntactic sugar for quick writing and neat code style,

Contributing

  1. Fork it (https://github.com/yourname/yourproject/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Author

Dmitry Vasilev

About

JavaScript calculator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published