-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Clara Tersi
authored and
Clara Tersi
committed
Jul 24, 2019
1 parent
1183611
commit af0ff83
Showing
5 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const add = (addend1, addend2) => { | ||
return addend1 + addend2; | ||
}; | ||
|
||
module.exports = add; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const divide = (dividend, divisor) => { | ||
if (divisor === 0) { | ||
throw new Error('Cannot divide by 0'); | ||
} | ||
return dividend / divisor; | ||
}; | ||
|
||
module.exports = divide; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const add = require('./add'); | ||
const divide = require('./divide'); | ||
const multiply = require('./multiply'); | ||
const subtract = require('./subtract'); | ||
|
||
module.exports = { | ||
add, | ||
divide, | ||
multiply, | ||
subtract, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const multiply = (multiplicand, multiplier) => { | ||
return multiplicand * multiplier; | ||
}; | ||
|
||
module.exports = multiply; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const subtract = (minuend, subtrahend) => { | ||
return minuend - subtrahend; | ||
}; | ||
|
||
module.exports = subtract; |