Fix: actually update the code snippet, not just the blurb
This commit is contained in:
@ -5,6 +5,6 @@ Use `isFinite()` to check if the number is finite.
|
||||
Use `Number()` to check if the coercion holds.
|
||||
|
||||
```js
|
||||
const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n);
|
||||
const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
|
||||
// validateNumber('10') -> true
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user