Skip to content

Instantly share code, notes, and snippets.

@Alex1990
Created August 18, 2014 01:51
Show Gist options
  • Save Alex1990/cbfe807ce9564bc6444e to your computer and use it in GitHub Desktop.
Save Alex1990/cbfe807ce9564bc6444e to your computer and use it in GitHub Desktop.
check if a string is blank (may contain white-space)
/*
* Ref: http://stackoverflow.com/questions/154059/how-do-you-check-for-an-empty-string-in-javascript
*/
function isBlank(str) {
return !str || !/\S/.test(str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment