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'
1414import startsWith from './startsWith'
1515import removeDuplicates from './remove-duplicates'
1616import add from './add'
17+ import subtract from './subtract'
1718
1819export {
1920 flatten ,
@@ -32,4 +33,5 @@ export {
3233 startsWith ,
3334 removeDuplicates ,
3435 add ,
36+ subtract ,
3537}
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