Travis build: 489
This commit is contained in:
174
README.md
174
README.md
@ -32,8 +32,6 @@
|
|||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
|
|
||||||
* [`arrayMax`](#arraymax)
|
|
||||||
* [`arrayMin`](#arraymin)
|
|
||||||
* [`chunk`](#chunk)
|
* [`chunk`](#chunk)
|
||||||
* [`compact`](#compact)
|
* [`compact`](#compact)
|
||||||
* [`countOccurrences`](#countoccurrences)
|
* [`countOccurrences`](#countoccurrences)
|
||||||
@ -142,8 +140,6 @@
|
|||||||
<details>
|
<details>
|
||||||
<summary>View contents</summary>
|
<summary>View contents</summary>
|
||||||
|
|
||||||
* [`arrayAverage`](#arrayaverage)
|
|
||||||
* [`arraySum`](#arraysum)
|
|
||||||
* [`clampNumber`](#clampnumber)
|
* [`clampNumber`](#clampnumber)
|
||||||
* [`collatz`](#collatz)
|
* [`collatz`](#collatz)
|
||||||
* [`digitize`](#digitize)
|
* [`digitize`](#digitize)
|
||||||
@ -255,6 +251,18 @@
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### _Uncategorized_
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>View contents</summary>
|
||||||
|
|
||||||
|
* [`average`](#average)
|
||||||
|
* [`max`](#max)
|
||||||
|
* [`min`](#min)
|
||||||
|
* [`sum`](#sum)
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
## Adapter
|
## Adapter
|
||||||
|
|
||||||
### call
|
### call
|
||||||
@ -425,52 +433,6 @@ arrayMax([1, 2, 4]); // 4
|
|||||||
|
|
||||||
## Array
|
## Array
|
||||||
|
|
||||||
### arrayMax
|
|
||||||
|
|
||||||
Returns the maximum value in an array.
|
|
||||||
|
|
||||||
Use `Math.max()` combined with the spread operator (`...`) to get the maximum value in the array.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const arrayMax = arr => Math.max(...arr);
|
|
||||||
```
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Examples</summary>
|
|
||||||
|
|
||||||
```js
|
|
||||||
arrayMax([10, 1, 5]); // 10
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
[⬆ Back to top](#table-of-contents)
|
|
||||||
|
|
||||||
|
|
||||||
### arrayMin
|
|
||||||
|
|
||||||
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 arrayMin = arr => Math.min(...arr);
|
|
||||||
```
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Examples</summary>
|
|
||||||
|
|
||||||
```js
|
|
||||||
arrayMin([10, 1, 5]); // 1
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
[⬆ Back to top](#table-of-contents)
|
|
||||||
|
|
||||||
|
|
||||||
### chunk
|
### chunk
|
||||||
|
|
||||||
Chunks an array into smaller arrays of a specified size.
|
Chunks an array into smaller arrays of a specified size.
|
||||||
@ -2251,52 +2213,6 @@ negate(isOdd)(1); // false
|
|||||||
|
|
||||||
## Math
|
## Math
|
||||||
|
|
||||||
### arrayAverage
|
|
||||||
|
|
||||||
Returns the average of an array of numbers.
|
|
||||||
|
|
||||||
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 arrayAverage = arr => arr.reduce((acc, val) => acc + val, 0) / arr.length;
|
|
||||||
```
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Examples</summary>
|
|
||||||
|
|
||||||
```js
|
|
||||||
arrayAverage([1, 2, 3]); // 2
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
[⬆ Back to top](#table-of-contents)
|
|
||||||
|
|
||||||
|
|
||||||
### arraySum
|
|
||||||
|
|
||||||
Returns the sum of an array of numbers.
|
|
||||||
|
|
||||||
Use `Array.reduce()` to add each value to an accumulator, initialized with a value of `0`.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const arraySum = arr => arr.reduce((acc, val) => acc + val, 0);
|
|
||||||
```
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Examples</summary>
|
|
||||||
|
|
||||||
```js
|
|
||||||
arraySum([1, 2, 3, 4]); // 10
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
[⬆ Back to top](#table-of-contents)
|
|
||||||
|
|
||||||
|
|
||||||
### clampNumber
|
### clampNumber
|
||||||
|
|
||||||
Clamps `num` within the inclusive range specified by the boundary values `a` and `b`.
|
Clamps `num` within the inclusive range specified by the boundary values `a` and `b`.
|
||||||
@ -4158,6 +4074,72 @@ validateNumber('10'); // true
|
|||||||
|
|
||||||
[⬆ Back to top](#table-of-contents)
|
[⬆ 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
|
||||||
|
```
|
||||||
|
|
||||||
|
[⬆ 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
|
||||||
|
```
|
||||||
|
|
||||||
|
[⬆ 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
|
||||||
|
```
|
||||||
|
|
||||||
|
[⬆ 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
|
||||||
|
```
|
||||||
|
|
||||||
|
[⬆ back to top](#table-of-contents)
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|||||||
@ -107,9 +107,7 @@
|
|||||||
<a class="sublink-1" href="#spreadover">spreadOver</a>
|
<a class="sublink-1" href="#spreadover">spreadOver</a>
|
||||||
|
|
||||||
<h3>Array
|
<h3>Array
|
||||||
</h3><a class="sublink-1" href="#arraymax">arrayMax</a>
|
</h3><a class="sublink-1" href="#chunk">chunk</a>
|
||||||
<a class="sublink-1" href="#arraymin">arrayMin</a>
|
|
||||||
<a class="sublink-1" href="#chunk">chunk</a>
|
|
||||||
<a class="sublink-1" href="#compact">compact</a>
|
<a class="sublink-1" href="#compact">compact</a>
|
||||||
<a class="sublink-1" href="#countoccurrences">countOccurrences</a>
|
<a class="sublink-1" href="#countoccurrences">countOccurrences</a>
|
||||||
<a class="sublink-1" href="#deepflatten">deepFlatten</a>
|
<a class="sublink-1" href="#deepflatten">deepFlatten</a>
|
||||||
@ -187,9 +185,7 @@
|
|||||||
</h3><a class="sublink-1" href="#negate">negate</a>
|
</h3><a class="sublink-1" href="#negate">negate</a>
|
||||||
|
|
||||||
<h3>Math
|
<h3>Math
|
||||||
</h3><a class="sublink-1" href="#arrayaverage">arrayAverage</a>
|
</h3><a class="sublink-1" href="#clampnumber">clampNumber</a>
|
||||||
<a class="sublink-1" href="#arraysum">arraySum</a>
|
|
||||||
<a class="sublink-1" href="#clampnumber">clampNumber</a>
|
|
||||||
<a class="sublink-1" href="#collatz">collatz</a>
|
<a class="sublink-1" href="#collatz">collatz</a>
|
||||||
<a class="sublink-1" href="#digitize">digitize</a>
|
<a class="sublink-1" href="#digitize">digitize</a>
|
||||||
<a class="sublink-1" href="#distance">distance</a>
|
<a class="sublink-1" href="#distance">distance</a>
|
||||||
@ -268,6 +264,12 @@
|
|||||||
<a class="sublink-1" href="#toordinalsuffix">toOrdinalSuffix</a>
|
<a class="sublink-1" href="#toordinalsuffix">toOrdinalSuffix</a>
|
||||||
<a class="sublink-1" href="#validatenumber">validateNumber</a>
|
<a class="sublink-1" href="#validatenumber">validateNumber</a>
|
||||||
|
|
||||||
|
<h3>Uncategorized
|
||||||
|
</h3><a class="sublink-1" href="#average">average</a>
|
||||||
|
<a class="sublink-1" href="#max">max</a>
|
||||||
|
<a class="sublink-1" href="#min">min</a>
|
||||||
|
<a class="sublink-1" href="#sum">sum</a>
|
||||||
|
|
||||||
</nav><main class="col-sm-12 col-md-8 col-lg-9" style="height:100%;overflow-y:auto;background:#eceef2;padding:0"><a id="top"> </a><h2 style="text-align:center">Adapter</h2>
|
</nav><main class="col-sm-12 col-md-8 col-lg-9" style="height:100%;overflow-y:auto;background:#eceef2;padding:0"><a id="top"> </a><h2 style="text-align:center">Adapter</h2>
|
||||||
<div class="card fluid"><div class="section double-padded"><h3 id="call">call</h3></div><div class="section double-padded">
|
<div class="card fluid"><div class="section double-padded"><h3 id="call">call</h3></div><div class="section double-padded">
|
||||||
<p>Given a key and a set of arguments, call them when given a context. Primarily useful in composition.</p>
|
<p>Given a key and a set of arguments, call them when given a context. Primarily useful in composition.</p>
|
||||||
@ -340,21 +342,7 @@ arrayMax([1, 2, 3]); // 3
|
|||||||
arrayMax([1, 2, 4]); // 4
|
arrayMax([1, 2, 4]); // 4
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</div></div><br/><h2 style="text-align:center">Array</h2>
|
</div></div><br/><h2 style="text-align:center">Array</h2>
|
||||||
<div class="card fluid"><div class="section double-padded"><h3 id="arraymax">arrayMax</h3></div><div class="section double-padded">
|
<div class="card fluid"><div class="section double-padded"><h3 id="chunk">chunk</h3></div><div class="section double-padded">
|
||||||
<p>Returns the maximum value in an array.</p>
|
|
||||||
<p>Use <code>Math.max()</code> combined with the spread operator (<code>...</code>) to get the maximum value in the array.</p>
|
|
||||||
<pre><code class="language-js">const arrayMax = arr => Math.max(...arr);
|
|
||||||
</code></pre>
|
|
||||||
<pre><code class="language-js">arrayMax([10, 1, 5]); // 10
|
|
||||||
</code></pre>
|
|
||||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="arraymin">arrayMin</h3></div><div class="section double-padded">
|
|
||||||
<p>Returns the minimum value in an array.</p>
|
|
||||||
<p>Use <code>Math.min()</code> combined with the spread operator (<code>...</code>) to get the minimum value in the array.</p>
|
|
||||||
<pre><code class="language-js">const arrayMin = arr => Math.min(...arr);
|
|
||||||
</code></pre>
|
|
||||||
<pre><code class="language-js">arrayMin([10, 1, 5]); // 1
|
|
||||||
</code></pre>
|
|
||||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="chunk">chunk</h3></div><div class="section double-padded">
|
|
||||||
<p>Chunks an array into smaller arrays of a specified size.</p>
|
<p>Chunks an array into smaller arrays of a specified size.</p>
|
||||||
<p>Use <code>Array.from()</code> to create a new array, that fits the number of chunks that will be produced.
|
<p>Use <code>Array.from()</code> to create a new array, that fits the number of chunks that will be produced.
|
||||||
Use <code>Array.slice()</code> to map each element of the new array to a chunk the length of <code>size</code>.
|
Use <code>Array.slice()</code> to map each element of the new array to a chunk the length of <code>size</code>.
|
||||||
@ -1047,21 +1035,7 @@ runPromisesInSeries([() => delay(1000), () => delay(2000)]); // //executes
|
|||||||
negate(isOdd)(1); // false
|
negate(isOdd)(1); // false
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</div></div><br/><h2 style="text-align:center">Math</h2>
|
</div></div><br/><h2 style="text-align:center">Math</h2>
|
||||||
<div class="card fluid"><div class="section double-padded"><h3 id="arrayaverage">arrayAverage</h3></div><div class="section double-padded">
|
<div class="card fluid"><div class="section double-padded"><h3 id="clampnumber">clampNumber</h3></div><div class="section double-padded">
|
||||||
<p>Returns the average of an array of numbers.</p>
|
|
||||||
<p>Use <code>Array.reduce()</code> to add each value to an accumulator, initialized with a value of <code>0</code>, divide by the <code>length</code> of the array.</p>
|
|
||||||
<pre><code class="language-js">const arrayAverage = arr => arr.reduce((acc, val) => acc + val, 0) / arr.length;
|
|
||||||
</code></pre>
|
|
||||||
<pre><code class="language-js">arrayAverage([1, 2, 3]); // 2
|
|
||||||
</code></pre>
|
|
||||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="arraysum">arraySum</h3></div><div class="section double-padded">
|
|
||||||
<p>Returns the sum of an array of numbers.</p>
|
|
||||||
<p>Use <code>Array.reduce()</code> to add each value to an accumulator, initialized with a value of <code>0</code>.</p>
|
|
||||||
<pre><code class="language-js">const arraySum = arr => arr.reduce((acc, val) => acc + val, 0);
|
|
||||||
</code></pre>
|
|
||||||
<pre><code class="language-js">arraySum([1, 2, 3, 4]); // 10
|
|
||||||
</code></pre>
|
|
||||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="clampnumber">clampNumber</h3></div><div class="section double-padded">
|
|
||||||
<p>Clamps <code>num</code> within the inclusive range specified by the boundary values <code>a</code> and <code>b</code>.</p>
|
<p>Clamps <code>num</code> within the inclusive range specified by the boundary values <code>a</code> and <code>b</code>.</p>
|
||||||
<p>If <code>num</code> falls within the range, return <code>num</code>.
|
<p>If <code>num</code> falls within the range, return <code>num</code>.
|
||||||
Otherwise, return the nearest number in the range.</p>
|
Otherwise, return the nearest number in the range.</p>
|
||||||
@ -1836,6 +1810,36 @@ Use <code>Number()</code> to check if the coercion holds.</p>
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
<pre><code class="language-js">validateNumber('10'); // true
|
<pre><code class="language-js">validateNumber('10'); // true
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
</div></div><br/><h2 style="text-align:center">Uncategorized</h2>
|
||||||
|
<div class="card fluid"><div class="section double-padded"><h3 id="average">average</h3></div><div class="section double-padded">
|
||||||
|
<p>Returns the average of an of two or more numbers/arrays.</p>
|
||||||
|
<p>Use <code>Array.reduce()</code> to add each value to an accumulator, initialized with a value of <code>0</code>, divide by the <code>length</code> of the array.</p>
|
||||||
|
<pre><code class="language-js">const average = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0) / arr.length;
|
||||||
|
</code></pre>
|
||||||
|
<pre><code class="language-js">average([1, 2, 3]); // 2
|
||||||
|
</code></pre>
|
||||||
|
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="max">max</h3></div><div class="section double-padded">
|
||||||
|
<p>Returns the maximum value out of two or more numbers/arrays.</p>
|
||||||
|
<p>Use <code>Math.max()</code> combined with the spread operator (<code>...</code>) to get the maximum value in the array.</p>
|
||||||
|
<pre><code class="language-js">
|
||||||
|
const max = (...arr) => Math.max(...[].concat(...arr);
|
||||||
|
</code></pre>
|
||||||
|
<pre><code class="language-js">max([10, 1, 5]); // 10
|
||||||
|
</code></pre>
|
||||||
|
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="min">min</h3></div><div class="section double-padded">
|
||||||
|
<p>Returns the minimum value in an array.</p>
|
||||||
|
<p>Use <code>Math.min()</code> combined with the spread operator (<code>...</code>) to get the minimum value in the array.</p>
|
||||||
|
<pre><code class="language-js">const min = arr => Math.min(...[].concat(...arr));
|
||||||
|
</code></pre>
|
||||||
|
<pre><code class="language-js">min([10, 1, 5]); // 1
|
||||||
|
</code></pre>
|
||||||
|
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="sum">sum</h3></div><div class="section double-padded">
|
||||||
|
<p>Returns the sum of an of two or more numbers/arrays.</p>
|
||||||
|
<p>Use <code>Array.reduce()</code> to add each value to an accumulator, initialized with a value of <code>0</code>.</p>
|
||||||
|
<pre><code class="language-js">const sum = (...arr) => [].concat(...arr).reduce((acc, val) => acc + val, 0);
|
||||||
|
</code></pre>
|
||||||
|
<pre><code class="language-js">sum([1, 2, 3, 4]); // 10
|
||||||
|
</code></pre>
|
||||||
</div></div><br/>
|
</div></div><br/>
|
||||||
<footer>
|
<footer>
|
||||||
<p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p>
|
<p style="display:inline-block"><strong>30 seconds of code</strong> is licensed under the <a href="https://github.com/Chalarangelo/30-seconds-of-code/blob/master/LICENSE">CC0-1.0</a> license.<br/>Icons made by <a href="https://www.flaticon.com/authors/smashicons">Smashicons</a> from <a href="https://www.flaticon.com/">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/">CC 3.0 BY</a>.<br/>Ribbon made by <a href="https://github.com/tholman/github-corners">Tim Holman</a> is licensed by <a href="https://opensource.org/licenses/MIT">The MIT License</a><br/>Built with the <a href="https://minicss.org">mini.css framework</a>.</p>
|
||||||
|
|||||||
@ -5,6 +5,7 @@ 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.
|
Use `Math.max()` combined with the spread operator (`...`) to get the maximum value in the array.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
||||||
const max = (...arr) => Math.max(...[].concat(...arr);
|
const max = (...arr) => Math.max(...[].concat(...arr);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
anagrams:string
|
anagrams:string
|
||||||
arrayAverage:math
|
|
||||||
arrayMax:array
|
|
||||||
arrayMin:array
|
|
||||||
arraySum:math
|
|
||||||
arrayToHtmlList:browser
|
arrayToHtmlList:browser
|
||||||
|
average:uncategorized
|
||||||
bottomVisible:browser
|
bottomVisible:browser
|
||||||
call:adapter
|
call:adapter
|
||||||
capitalize:string
|
capitalize:string
|
||||||
@ -79,7 +76,9 @@ JSONToFile:node
|
|||||||
last:array
|
last:array
|
||||||
lcm:math
|
lcm:math
|
||||||
mapObject:array
|
mapObject:array
|
||||||
|
max:uncategorized
|
||||||
median:math
|
median:math
|
||||||
|
min:uncategorized
|
||||||
negate:logic
|
negate:logic
|
||||||
nthElement:array
|
nthElement:array
|
||||||
objectFromPairs:object
|
objectFromPairs:object
|
||||||
@ -121,6 +120,7 @@ sortCharactersInString:string
|
|||||||
speechSynthesis:media
|
speechSynthesis:media
|
||||||
spreadOver:adapter
|
spreadOver:adapter
|
||||||
standardDeviation:math
|
standardDeviation:math
|
||||||
|
sum:uncategorized
|
||||||
symmetricDifference:array
|
symmetricDifference:array
|
||||||
tail:array
|
tail:array
|
||||||
take:array
|
take:array
|
||||||
|
|||||||
Reference in New Issue
Block a user