File tree 6 files changed +18
-12
lines changed
6 files changed +18
-12
lines changed Original file line number Diff line number Diff line change
1
+ import leastArguments from '../_utils/leastArguments' ;
2
+
1
3
/**
2
4
* @name difference
3
5
* @summary Gets the difference.
@@ -43,9 +45,8 @@ export default function difference(
43
45
const argLength = arguments . length ;
44
46
switch ( argLength ) {
45
47
case 0 :
46
- return 0 ;
47
48
case 1 :
48
- return a ;
49
+ return leastArguments ( 2 , argLength ) ;
49
50
case 2 :
50
51
return a - b ;
51
52
case 3 :
Original file line number Diff line number Diff line change
1
+ import leastArguments from '../_utils/leastArguments' ;
2
+
1
3
/**
2
4
* @name mean
3
5
* @summary Gets the mean (average).
@@ -43,9 +45,8 @@ export default function mean(
43
45
const argLength = arguments . length ;
44
46
switch ( argLength ) {
45
47
case 0 :
46
- return 0 ;
47
48
case 1 :
48
- return a ;
49
+ return leastArguments ( 2 , argLength ) ;
49
50
case 2 :
50
51
return ( a + b ) / 2 ;
51
52
case 3 :
Original file line number Diff line number Diff line change
1
+ import leastArguments from '../_utils/leastArguments' ;
2
+
1
3
/**
2
4
* @name product
3
5
* @summary Gets the product.
@@ -43,9 +45,8 @@ export default function product(
43
45
const argLength = arguments . length ;
44
46
switch ( argLength ) {
45
47
case 0 :
46
- return 0 ;
47
48
case 1 :
48
- return a ;
49
+ return leastArguments ( 2 , argLength ) ;
49
50
case 2 :
50
51
return a * b ;
51
52
case 3 :
Original file line number Diff line number Diff line change
1
+ import leastArguments from '../_utils/leastArguments' ;
2
+
1
3
/**
2
4
* @name quotient
3
5
* @summary Gets the quotient.
@@ -43,9 +45,8 @@ export default function quotient(
43
45
const argLength = arguments . length ;
44
46
switch ( argLength ) {
45
47
case 0 :
46
- return 0 ;
47
48
case 1 :
48
- return a ;
49
+ return leastArguments ( 2 , argLength ) ;
49
50
case 2 :
50
51
return a / b ;
51
52
case 3 :
Original file line number Diff line number Diff line change
1
+ import leastArguments from '../_utils/leastArguments' ;
2
+
1
3
/**
2
4
* @name remainder
3
5
* @summary Gets the remainder.
@@ -43,9 +45,8 @@ export default function remainder(
43
45
const argLength = arguments . length ;
44
46
switch ( argLength ) {
45
47
case 0 :
46
- return 0 ;
47
48
case 1 :
48
- return a ;
49
+ return leastArguments ( 2 , argLength ) ;
49
50
case 2 :
50
51
return a % b ;
51
52
case 3 :
Original file line number Diff line number Diff line change
1
+ import leastArguments from '../_utils/leastArguments' ;
2
+
1
3
/**
2
4
* @name sum
3
5
* @summary Gets the sum.
@@ -43,9 +45,8 @@ export default function sum(
43
45
const argLength = arguments . length ;
44
46
switch ( argLength ) {
45
47
case 0 :
46
- return 0 ;
47
48
case 1 :
48
- return a ;
49
+ return leastArguments ( 2 , argLength ) ;
49
50
case 2 :
50
51
return a + b ;
51
52
case 3 :
You can’t perform that action at this time.
0 commit comments