Travis build: 534
This commit is contained in:
232
README.md
232
README.md
@ -140,6 +140,7 @@
|
||||
<details>
|
||||
<summary>View contents</summary>
|
||||
|
||||
* [`average`](#average)
|
||||
* [`clampNumber`](#clampnumber)
|
||||
* [`collatz`](#collatz)
|
||||
* [`digitize`](#digitize)
|
||||
@ -156,7 +157,9 @@
|
||||
* [`isEven`](#iseven)
|
||||
* [`isPrime`](#isprime)
|
||||
* [`lcm`](#lcm)
|
||||
* [`max`](#max)
|
||||
* [`median`](#median)
|
||||
* [`min`](#min)
|
||||
* [`palindrome`](#palindrome)
|
||||
* [`percentile`](#percentile)
|
||||
* [`powerset`](#powerset)
|
||||
@ -165,6 +168,7 @@
|
||||
* [`randomNumberInRange`](#randomnumberinrange)
|
||||
* [`round`](#round)
|
||||
* [`standardDeviation`](#standarddeviation)
|
||||
* [`sum`](#sum)
|
||||
|
||||
</details>
|
||||
|
||||
@ -251,18 +255,6 @@
|
||||
|
||||
</details>
|
||||
|
||||
### _Uncategorized_
|
||||
|
||||
<details>
|
||||
<summary>View contents</summary>
|
||||
|
||||
* [`average`](#average)
|
||||
* [`max`](#max)
|
||||
* [`min`](#min)
|
||||
* [`sum`](#sum)
|
||||
|
||||
</details>
|
||||
|
||||
## Adapter
|
||||
|
||||
### call
|
||||
@ -2213,6 +2205,29 @@ negate(isOdd)(1); // false
|
||||
|
||||
## Math
|
||||
|
||||
### average
|
||||
|
||||
Returns the average of an of two or more numbers/arrays.
|
||||
|
||||
Use `Array.reduce()` to add each value to an accumulator, initialized with a value of `0`, divide by the `length` of the array.
|
||||
|
||||
```js
|
||||
const average = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0) / arr.length;
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
average([1, 2, 3]); // 2
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### clampNumber
|
||||
|
||||
Clamps `num` within the inclusive range specified by the boundary values `a` and `b`.
|
||||
@ -2641,6 +2656,57 @@ lcm([1, 3, 4], 5); // 60
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### max
|
||||
|
||||
Returns the maximum value out of two or more numbers/arrays.
|
||||
|
||||
Use `Math.max()` combined with the spread operator (`...`) to get the maximum value in the array.
|
||||
|
||||
```js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const max = (...arr) => Math.max(...[].concat(...arr);
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
max([10, 1, 5]); // 10
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### median
|
||||
|
||||
Returns the median of an array of numbers.
|
||||
@ -2670,6 +2736,29 @@ median([0, 10, -2, 7]); // 3.5
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### min
|
||||
|
||||
Returns the minimum value in an array.
|
||||
|
||||
Use `Math.min()` combined with the spread operator (`...`) to get the minimum value in the array.
|
||||
|
||||
```js
|
||||
const min = arr => Math.min(...[].concat(...arr));
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
min([10, 1, 5]); // 1
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### palindrome
|
||||
|
||||
Returns `true` if the given string is a palindrome, `false` otherwise.
|
||||
@ -2880,6 +2969,29 @@ standardDeviation([10, 2, 38, 23, 38, 23, 21], true); // 12.29899614287479 (popu
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### sum
|
||||
|
||||
Returns the sum of an of two or more numbers/arrays.
|
||||
|
||||
Use `Array.reduce()` to add each value to an accumulator, initialized with a value of `0`.
|
||||
|
||||
```js
|
||||
const sum = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0);
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
sum([1, 2, 3, 4]); // 10
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
## Media
|
||||
@ -4074,102 +4186,6 @@ validateNumber('10'); // true
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
## _Uncategorized_
|
||||
|
||||
### average
|
||||
|
||||
Returns the average of an of two or more numbers/arrays.
|
||||
|
||||
Use `Array.reduce()` to add each value to an accumulator, initialized with a value of `0`, divide by the `length` of the array.
|
||||
|
||||
```js
|
||||
const average = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0) / arr.length;
|
||||
```
|
||||
|
||||
```js
|
||||
average([1, 2, 3]); // 2
|
||||
```
|
||||
|
||||
<br>[⬆ back to top](#table-of-contents)
|
||||
|
||||
|
||||
### max
|
||||
|
||||
Returns the maximum value out of two or more numbers/arrays.
|
||||
|
||||
Use `Math.max()` combined with the spread operator (`...`) to get the maximum value in the array.
|
||||
|
||||
```js
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const max = (...arr) => Math.max(...[].concat(...arr);
|
||||
```
|
||||
|
||||
```js
|
||||
max([10, 1, 5]); // 10
|
||||
```
|
||||
|
||||
<br>[⬆ back to top](#table-of-contents)
|
||||
|
||||
|
||||
### min
|
||||
|
||||
Returns the minimum value in an array.
|
||||
|
||||
Use `Math.min()` combined with the spread operator (`...`) to get the minimum value in the array.
|
||||
|
||||
```js
|
||||
const min = arr => Math.min(...[].concat(...arr));
|
||||
```
|
||||
|
||||
```js
|
||||
min([10, 1, 5]); // 1
|
||||
```
|
||||
|
||||
<br>[⬆ back to top](#table-of-contents)
|
||||
|
||||
|
||||
### sum
|
||||
|
||||
Returns the sum of an of two or more numbers/arrays.
|
||||
|
||||
Use `Array.reduce()` to add each value to an accumulator, initialized with a value of `0`.
|
||||
|
||||
```js
|
||||
const sum = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0);
|
||||
```
|
||||
|
||||
```js
|
||||
sum([1, 2, 3, 4]); // 10
|
||||
```
|
||||
|
||||
<br>[⬆ back to top](#table-of-contents)
|
||||
|
||||
|
||||
## Credits
|
||||
|
||||
|
||||
Reference in New Issue
Block a user