Skip to content

Instantly share code, notes, and snippets.

@pparadis
Created July 8, 2012 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pparadis/3071037 to your computer and use it in GitHub Desktop.
Save pparadis/3071037 to your computer and use it in GitHub Desktop.
String.IsNullOrEmpty javascript
String.IsNullOrEmpty = function(value) {
var isNullOrEmpty = true;
if (value) {
if (typeof (value) == 'string') {
if (value.length > 0)
isNullOrEmpty = false;
}
}
return isNullOrEmpty;
}
@firatoltulu
Copy link

Hi,
if contains value equal 0 it passed true but that is not correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment