Skip to content

Instantly share code, notes, and snippets.

@Nicknyr
Created April 5, 2020 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nicknyr/7aa4c93b75fc2eb349684c7d11a6869c to your computer and use it in GitHub Desktop.
Save Nicknyr/7aa4c93b75fc2eb349684c7d11a6869c to your computer and use it in GitHub Desktop.
CodeSignal - Is Digit
/*
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