Created
January 26, 2021 17:15
-
-
Save Sanchithasharma/b96c40c8878cdf2c5d5ab8878f2a83b5 to your computer and use it in GitHub Desktop.
Check if the variable is number using Number.isFinite()
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
var numberOfpushUpsToday = 34; | |
if(Number.isFinite(numberOfpushUpsToday) ){ | |
console.log('It is a number') | |
} | |
else { | |
console.log('It is not a number') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment