This repository was archived by the owner on Feb 20, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import startsWith from './startsWith'
20
20
import removeDuplicates from './remove-duplicates'
21
21
import add from './add'
22
22
import subtract from './subtract'
23
+ import subtraction from './subtraction'
23
24
import divide from './divide'
24
25
import multiply from './multiply'
25
26
import square from './square'
@@ -74,4 +75,6 @@ export {
74
75
round ,
75
76
checkPalindrome ,
76
77
isFunction ,
78
+ subtraction ,
77
79
}
80
+
Original file line number Diff line number Diff line change
1
+ export default subtraction
2
+
3
+ /**
4
+ *
5
+ * This method will return a random integer
6
+ * between min and max number
7
+ *
8
+ * @param {Number } num1 - The first number to be subtracted
9
+ * @param {Number } max - The second number to subtract from
10
+ * @return {Number } the subtraction of num1 - num2
11
+ */
12
+
13
+ function subtraction ( num1 , num2 ) {
14
+ return num1 - num2
15
+ }
Original file line number Diff line number Diff line change
1
+ import test from 'ava'
2
+ import subtraction from '../src/subtraction'
3
+
4
+ test ( 'Subtracts two integers ' , t => {
5
+ const number1 = 23
6
+ const number2 = 3
7
+ const expected = 23 - 3
8
+ const actual = subtraction ( number1 , number2 )
9
+ t . deepEqual ( actual , expected )
10
+ } )
You can’t perform that action at this time.
0 commit comments