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 +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import isNullOrWhitespace from './is-null-or-whitespace'
14
14
import startsWith from './startsWith'
15
15
import removeDuplicates from './remove-duplicates'
16
16
import add from './add'
17
+ import subtract from './subtract'
17
18
18
19
export {
19
20
flatten ,
@@ -32,4 +33,5 @@ export {
32
33
startsWith ,
33
34
removeDuplicates ,
34
35
add ,
36
+ subtract ,
35
37
}
Original file line number Diff line number Diff line change
1
+ export default Subtract
2
+
3
+ /**
4
+ * @module Subtract
5
+ * @Description This method will perform Subtract operation.
6
+ *
7
+ * @param {Number } num1 - first number for Subtraction
8
+ * @param {Number } num2 - second number for Subtraction
9
+ * @return {Number } - Result of Subtraction
10
+ */
11
+ function Subtract ( num1 , num2 ) {
12
+ return num1 - num2
13
+ }
Original file line number Diff line number Diff line change
1
+ import test from 'ava'
2
+ import { subtract } from '../src'
3
+
4
+ test ( 'subtract two integers ' , t => {
5
+ const number1 = 30
6
+ const number2 = 12
7
+ const expected = 30 - 12
8
+ const actual = subtract ( number1 , number2 )
9
+ t . deepEqual ( actual , expected )
10
+ } )
You can’t perform that action at this time.
0 commit comments