We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4388ee4 commit d84a612Copy full SHA for d84a612
functions/sum/exercise/script.js
@@ -8,23 +8,31 @@
8
ES6 Syntax (Arrow function): const add = () => {}
9
*/
10
11
-function add(){
+function add(a, b){
12
//Add function here
13
+ return a + b;
14
}
15
-function sub(){
16
+function sub(a, b){
17
//Subtract function here
18
+ return a-b
19
20
-function div(){
21
+function div(a, b){
22
//Divide function here
23
+ if (b === 0) {
24
+ return -1;
25
+ }
26
+ return a/b
27
28
-function mul(){
29
+function mul(a, b){
30
//Multiply function here
31
+ return a*b
32
33
34
console.log('hello from the SUM exercise')
35
/*
36
TODO: create a function that console logs the result of any of the above operations.
-*/
37
+*/
38
+console.log(div(10,5))
0 commit comments