Skip to content

Instantly share code, notes, and snippets.

@danielborowski
Created October 30, 2016 04:51
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 danielborowski/6af7d43cef5ec6e9dd9554ff41f6fb4e to your computer and use it in GitHub Desktop.
Save danielborowski/6af7d43cef5ec6e9dd9554ff41f6fb4e to your computer and use it in GitHub Desktop.
// this function should return true if the string contains no numbers
// we are using the isNaN function to determine if a character is a number or not
function noNumbers(str) {
for (var i = 0; i < str.length; i++) {
if (isNaN(str[i])) {
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment