Nodejs String Empty Check isEmpty()

Here you can find the source of isEmpty()

Method Source Code

String.prototype.isEmpty = function () {
   return (!this || this == "[object Null]" || this == "" || this == "undefined");
}

Related

  1. isEmpty()
    String.prototype.isEmpty = function() {
      return this.toString().trim() == "";
    };
    
  2. isEmpty()
    String.prototype.isEmpty = function() {
      return (!this || 0 === this.length);
    };
    
  3. isEmpty()
    String.prototype.isEmpty = function() {
      return (this == '');
    };
    
  4. isEmpty()
    String.prototype.isEmpty = function () {
      "use strict";
      return (this.length === 0 || !this.trim());
    };
    
  5. isEmpty()
    String.prototype.isEmpty=function(){
      return this.trim()=="";
    };
    
  6. isEmpty()
    String.prototype.isEmpty = function() {
      return this.trim() === "";
    
  7. isEmpty()
    String.prototype.isEmpty = function(){
        return (this === null || this === '');
    };
    
  8. isEmpty()
    String.prototype.isEmpty = function() {
       return (this.length === 0 || !this.trim());
    Array.prototype.appendStringToElementAtIndex = function(index, str) {
        if(typeof this[index] === 'undefined' || typeof this[index] !== 'string') return false;
        this[index] += ' ' + str;
    };
    
  9. isEmpty()
    String.prototype.isEmpty = function() {
        return (this.length === 0 || !this.trim());
    };