Skip to content

Instantly share code, notes, and snippets.

@pinalbhatt
Created June 22, 2015 12:05
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 pinalbhatt/d7cb74b2ecdb0cbc9705 to your computer and use it in GitHub Desktop.
Save pinalbhatt/d7cb74b2ecdb0cbc9705 to your computer and use it in GitHub Desktop.
Javascript isNullOrWhitespace
function isNullOrWhitespace( input ) {
if (typeof input === 'undefined' || input == null) return true;
return input.replace(/\s/g, '').length < 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment