Created
January 26, 2021 17:06
-
-
Save Sanchithasharma/a12cbf39f9a78447c01faabe3da53b23 to your computer and use it in GitHub Desktop.
Check if variable is a number using typeof
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(typeof numberOfpushUpsToday === 'number' ){ | |
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