Go Back

Lesson 1 || (+ - * / %) calculators
  1. make a new repl html, css, js project
  2. copy the lesson 1 index.html, script.js, and style.css code into the repl
  3. in the repl console pane on the bottom right, type add(3,5) hint: you should see 8
  4. try doing the same for subtract, multiply, divide, and mod
  5. notice subtract returns todo, and multiply causes an error because the function doesn't exist
  6. go into script.js, and look at how the add function is written
  7. in a computer, add is +, subtract is -, multiply is *, and divide is /
  8. see the notes on the main course page on "JS Functions"
  9. based on the add function, change the subtract function so it works correctly
  10. write the multiply function from scratch
  11. on repl, hit the github branch icon , commit, and push your changes to a new repo named lesson1.

Arithmetic Calculator :

? =

in the repl console below, try typing add(3,5)