Created
October 4, 2023 17:43
-
-
Save gregpalaci/47530d43d2652ca4ba2d6bed82797618 to your computer and use it in GitHub Desktop.
Ensure a String is Numeric in JavaScript
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
/** | |
* Determine whether the given `input` is a number. | |
* | |
* @param {String} input | |
* | |
* @returns {Boolean} | |
*/ | |
const isNumericString = (input) => typeof input === 'string' && !Number.isNaN(input) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment