Created
April 5, 2020 02:50
-
-
Save Nicknyr/7aa4c93b75fc2eb349684c7d11a6869c to your computer and use it in GitHub Desktop.
CodeSignal - Is Digit
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 if the given character is a digit or not. | |
Example | |
For symbol = '0', the output should be | |
isDigit(symbol) = true; | |
For symbol = '-', the output should be | |
isDigit(symbol) = false. | |
*/ | |
function isDigit(symbol) { | |
if(symbol >= 0) { | |
return true; | |
} | |
else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment