From df1523afa6ca44fc7d2f8a590e1b8978ba1fd077 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Sat, 21 May 2022 11:10:30 +0600 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=91=BE=20add=20information=20about=20?= =?UTF-8?q?test=20functions=20to=20summary=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1-js/05-data-types/02-number/article.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/1-js/05-data-types/02-number/article.md b/1-js/05-data-types/02-number/article.md index 0e7c8b6c..10fd44c9 100644 --- a/1-js/05-data-types/02-number/article.md +++ b/1-js/05-data-types/02-number/article.md @@ -429,6 +429,10 @@ For different numeral systems: - `parseInt(str, base)` parses the string `str` into an integer in numeral system with given `base`, `2 ≤ base ≤ 36`. - `num.toString(base)` converts a number to a string in the numeral system with the given `base`. +For regular number tests: +- `isNaN(value)` converts its argument to a number and then tests it for being `NaN` +- `isFinite(value)` converts its argument to a number and returns `true` if it's a regular number, not `NaN/Infinity/-Infinity` + For converting values like `12pt` and `100px` to a number: - Use `parseInt/parseFloat` for the "soft" conversion, which reads a number from a string and then returns the value they could read before the error. From ef5bb390d6d58124135b93d3dc78e804978137bb Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Sat, 21 May 2022 11:11:08 +0600 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=91=BE=20smth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1-js/05-data-types/02-number/article.md | 1 + 1 file changed, 1 insertion(+) diff --git a/1-js/05-data-types/02-number/article.md b/1-js/05-data-types/02-number/article.md index 10fd44c9..70e798bd 100644 --- a/1-js/05-data-types/02-number/article.md +++ b/1-js/05-data-types/02-number/article.md @@ -430,6 +430,7 @@ For different numeral systems: - `num.toString(base)` converts a number to a string in the numeral system with the given `base`. For regular number tests: + - `isNaN(value)` converts its argument to a number and then tests it for being `NaN` - `isFinite(value)` converts its argument to a number and returns `true` if it's a regular number, not `NaN/Infinity/-Infinity`