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/6e13c88090abf28e2547dcc7218cf2e1 to your computer and use it in GitHub Desktop.
Save danielborowski/6e13c88090abf28e2547dcc7218cf2e1 to your computer and use it in GitHub Desktop.
// this function will now correctly return true if the string contains no numbers
// otherwise it will return false
function noNumbers(str) {
for (var i = 0; i < str.length; i++) {
if (!isNaN(str[i])) {
return false;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment