Created
January 20, 2020 08:51
-
-
Save droid001/cdb0afe379669795c68c7552111e8c9e to your computer and use it in GitHub Desktop.
Checks if the value is a number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Checks if the value is a Number. | |
* For a longer discussion on the solution see: https://medium.com/javascript-in-plain-english/how-to-check-for-a-number-in-javascript-8d9024708153 | |
*/ | |
export const isNumber = val=>Number.isFinite(val); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment