From 11f120abbdb336a4a48d60ac8a8690795973b0f8 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 30 Dec 2017 11:00:08 +0000 Subject: [PATCH] Travis build: 653 --- README.md | 9 +++++---- docs/index.html | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6e58830e2..710164935 100644 --- a/README.md +++ b/README.md @@ -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 => Examples ```js -factorial(6); // [0, 1, 1, 2, 3, 5] +factorial(6); // 720 ``` @@ -2304,7 +2304,7 @@ const fibonacci = n => Examples ```js -fibonacci(6); // 720 +fibonacci(6); // [0, 1, 1, 2, 3, 5] ``` @@ -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/).* + diff --git a/docs/index.html b/docs/index.html index be337d555..56bfe1b42 100644 --- a/docs/index.html +++ b/docs/index.html @@ -845,4 +845,4 @@ console.log(sdbm('age')); // 808122783
toOrdinalSuffix('123'); // "123rd"
 

validateNumber

Returns true if the given value is a number, false otherwise.

Use !isNaN in combination with parseFloat() to check if the argument is a number. Use isFinite() to check if the number is finite. Use Number() to check if the coercion holds.

const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
 
validateNumber('10'); // true
-

+
\ No newline at end of file