Giter Site home page Giter Site logo

hs-vanilla-js-calculator's Introduction

JavaScript Calculator

It's time to build a calculator. You all have some idea of how a calculator works: you enter two numbers and an operator and then the calculator gives you the solution.

Let's Get Started

You'll be coding your solution in js/calc.js. You also need to fill out index.html. We've left it blank this time, so you'll need to fill out the basic HTML structure and link your JavaScript file. Remember to have index.html open in the browser so that you can see the changes you made to js/calc.js.

Think about how you take in user input with Javascript. What function did we use for that? You'll want to store the input from your user in variables so you know what numbers and operator they want to work with.

From there, you'll want your app to trigger different actions based on the information the user entered. If they entered a + then you want the calculator to do addition, subtraction for -, etc.

How all of this comes together is up to you!

Bonus

It would be pretty cool if you could make this like a normal calculator on the computer where you just typed numbers and the operator into a form and pressed submit. You'd have to use jQuery for for submission, and some HTML to create the form. It might take some seriously Googling, but see if you can give it a try!

View JavaScript Calculator on Learn.co and start learning to code for free.

hs-vanilla-js-calculator's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.