Git Product home page Git Product logo

basiccalculator's Introduction

BasicCalculator

JavaScript Practise - BasicCalculator

basiccalculator's People

Contributors

alexreid95 avatar

Watchers

 avatar

basiccalculator's Issues

Specific styles with *

Adding specific styles to every element on the page can be dangerous, especially in a bigger codebase with other people on your team. If you want to avoid repeating CSS rules you can rely on inheritance: setting a rule on a parent will allow its children to inherit it.

For example all your elements are children of .grid-wrap, so you could set the font-size, weight and family there. The only caveat is certain elements (including buttons) don't inherit most styles by default, so you'll have to tell them to:

button {
  font: inherit;
  color: inherit;
}

Semantic HTML

HTML contains a lot of elements which can be used to give more meaning to our code - using sections, articles, headers etc. will make your code clearer and increase accessibility.

Wherever you can, avoid using <div>'s in favour of <sections> or <articles>.

Have a look at this if you'd like to read more ๐Ÿ“–

Good use of ===

Seems like you have a good understanding of the difference between using === compared to == โš–๏ธ

Deployment

Glad to see you've deployed your code and added the link to the description. This makes it so easy to see the live version and it's great practice to deploy early. ๐Ÿš€

Styling

I like the design choices you've made. A good contrast of colours with the calculator and it's really easy to use ๐Ÿ’…

Good use of eval

eval makes the calculation code a lot simpler! In this specific case it's definitely ok.

However, be aware that eval is quite dangerous to use in general code though, especially with user input. Since it executes whatever it is given with full access (just like your own code) a malicious user could potentially do some damage in a "real" app.

Nice use of CSS grid

Your grid layout is nice and elegant. You haven't had to specify every single button into place, you've let the browser do most of the work ๐ŸŽ‰

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.