Travis build: 653
This commit is contained in:
@ -1108,8 +1108,8 @@ console.log(pulled); // [ 'b', 'd' ]
|
||||
|
||||
QuickSort an Array (ascending sort by default).
|
||||
|
||||
Use recursion.
|
||||
Use `Array.filter` and spread operator (`...`) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it.
|
||||
Use recursion.
|
||||
Use `Array.filter` and spread operator (`...`) to create an array that all elements with values less than the pivot come before the pivot, and all elements with values greater than the pivot come after it.
|
||||
If the parameter `desc` is truthy, return array sorts in descending order.
|
||||
|
||||
```js
|
||||
@ -2277,7 +2277,7 @@ const factorial = n =>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
factorial(6); // [0, 1, 1, 2, 3, 5]
|
||||
factorial(6); // 720
|
||||
```
|
||||
|
||||
</details>
|
||||
@ -2304,7 +2304,7 @@ const fibonacci = n =>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
fibonacci(6); // 720
|
||||
fibonacci(6); // [0, 1, 1, 2, 3, 5]
|
||||
```
|
||||
|
||||
</details>
|
||||
@ -4162,3 +4162,4 @@ validateNumber('10'); // true
|
||||
## Credits
|
||||
|
||||
*Icons made by [Smashicons](https://www.flaticon.com/authors/smashicons) from [www.flaticon.com](https://www.flaticon.com/) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/).*
|
||||
|
||||
|
||||
@ -845,4 +845,4 @@ console.log(sdbm('age')); // 808122783
|
||||
</code></pre><pre><code class="language-js">toOrdinalSuffix('123'); // "123rd"
|
||||
</code></pre></div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="validatenumber">validateNumber</h3></div><div class="section double-padded"><p>Returns <code>true</code> if the given value is a number, <code>false</code> otherwise.</p><p>Use <code>!isNaN</code> in combination with <code>parseFloat()</code> to check if the argument is a number. Use <code>isFinite()</code> to check if the number is finite. Use <code>Number()</code> to check if the coercion holds.</p><pre><code class="language-js">const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
|
||||
</code></pre><pre><code class="language-js">validateNumber('10'); // true
|
||||
</code></pre></div></div><br/><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><a href="#top"><span style="display:inline-block;float:right;padding-right:2em">Back to top</span></a></footer></main></div><script src="prism.js"></script></body></html>
|
||||
</code></pre></div></div><br/><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><a href="#top"><span style="display:inline-block;float:right;padding-right:2em">Back to top</span></a></footer></main></div><script src="prism.js"></script></body></html>
|
||||
Reference in New Issue
Block a user