Nodejs String Empty Check isEmpty()

Here you can find the source of isEmpty()

Method Source Code

String.prototype.isEmpty = function() {
  return (!this || 0 === this.length);
};

Related

  1. isEmpty()
    "use strict";
    String.prototype.isEmpty = function() {
        return (this.length === 0 || !this.trim());
    };
    
  2. isEmpty()
    String.prototype.isEmpty = function() {
      return this.length === 0 || !this.trim();
    };
    
  3. isEmpty()
    String.prototype.isEmpty = function() {
        return this == null || this == '';
    };
    RegExp.escape = function(val) {
        return val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
    };
    
  4. isEmpty()
    String.prototype.isEmpty = function() { 
      return (!this.length) 
    
  5. isEmpty()
    String.prototype.isEmpty = function() {
      return this.toString().trim() == "";
    };
    
  6. isEmpty()
    String.prototype.isEmpty = function() {
      return (this == '');
    };
    
  7. isEmpty()
    String.prototype.isEmpty = function () {
      "use strict";
      return (this.length === 0 || !this.trim());
    };
    
  8. isEmpty()
    String.prototype.isEmpty=function(){
      return this.trim()=="";
    };
    
  9. isEmpty()
    String.prototype.isEmpty = function () {
      return (!this || this == "[object Null]" || this == "" || this == "undefined");