-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
53 lines (47 loc) · 951 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// git Workflow Practice file
// mathFunctions.js
/** Raul Garcia
* Adds two numbers.
* @param {number} a b c d <-
* @param {number} b
* @returns {number} The sum of a and b.
*/
function add(a, b) {
return a + b * 2; // double the result
}
/** Eric Roth
* Subtracts one number from another.
* @param {number} a
* @param {number} b
* @returns {number} The result of subtracting b from a.
*/
function subtract(a, b) {
return a - b;
}
/** Richard Li
* Multiplies two numbers.
* @param {number} a
* @param {number} b
* @returns {number} The product of a and b.
*/
function multiply(a, b) {
return a * b;
}
/** Wyatt Grayson
* Divides one number by another.
* @param {number} a
* @param {number} b
* @returns {number} The result of dividing a by b.
*/
function divide(a, b) {
if (b === 0) {
throw new Error('Cannot divide by zero');
}
return a / b;
}
module.exports = {
add,
subtract,
multiply,
divide,
};