-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath.js
51 lines (43 loc) · 1.22 KB
/
math.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
// write basic arithmetic operations in javascript
// add, subtract, multiply, devide
// write a function that takes two numbers and returns the sum of them
// write a function that takes two numbers and returns the difference of them
// write a function that takes two numbers and returns the product of them
// write a function that takes two numbers and returns the quotient of them
// Bonus: write a function that takes two numbers and returns the remainder of them
// hint take a look at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder
//@ts-check
/**
* Description
* @param {number} a
* @param {number} b
* @returns {number} The sum of a and b
*/
function add(a, b) {
return a - b;
}
/**
* @param {number} a
* @param {number} b
* @returns The difference of a and b
*/
function subtract() {}
/**
* @param {number} a
* @param {number} b
* @returns The product of a and b
*/
function multiply() {}
/**
* @param {number} a
* @param {number} b
* @returns The quotient of a and b
*/
function devide() {}
/**
* @param {number} a
* @param {number} b
* @returns The remainder of a and b
*/
function remainder() {}
module.exports = { add, subtract, multiply, devide, remainder };