Giter Club home page Giter Club logo

calc-you-later-backend-1's Introduction

Calc You Later

Introduction

Today we're going to be building the back end for a basic calculator. Don't worry, it's way easier than it sounds!

Workflow

This is a test-driven app. You'll do all of your work in calculate-back-end.js, and within that file, you'll be making just one function, called calculate. Look at the tests in calculate.test.js for reference, as well as the test descriptions in your terminal.

Tips and Tricks

  • Note that the numbers are being passed in as strings, but the return value should be in numbers. What's more, some of the math may be funky if you try to do the math while they're still strings. Be sure to look into how to convert a string to a number in JavaScript!
  • if/else chains and switch are good ways to check which operation you were passed. But whether you use those or another operation-checking method, you'll definitely want to branch your logic based on the contents of that string.
  • Don't conflate the symbols and their mathematical operations. There's no good way to use the '+' string--instead you want to check the operation's string and, if it's '+', return a sum. Think of the '+' string as no different than the string 'plus'--you'll have to handle both, and while only one of them is a JavaScript operator, they're both strings you can check against expected values.

calc-you-later-backend-1's People

Contributors

abbreviatedman avatar armynavy10 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.