Go Back
Lesson 1 || (+ - * / %) calculators
- make a new repl html, css, js project
- copy the lesson 1
index.html, script.js, and style.css code into the repl
- in the repl console pane on the bottom right, type add(3,5) hint: you should see 8
- try doing the same for subtract, multiply, divide, and mod
- notice subtract returns todo, and multiply causes an error because the function doesn't exist
- go into script.js, and look at how the add function is written
- in a computer, add is +, subtract is -, multiply is *, and divide is /
- see the notes on the main course page on "JS Functions"
- based on the add function, change the subtract function so it works correctly
- write the multiply function from scratch
- 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)