Nodejs String Empty Check isEmpty()

Here you can find the source of isEmpty()

Method Source Code

String.prototype.isEmpty = function() {
   return this == '';
};

Related

  1. isNullOrEmpty()
    String.prototype.isNullOrEmpty = function(){
        return !(this && this.length > 0);
    };
    
  2. isNullOrEmpty()
    String.prototype.isNullOrEmpty = function () {
      return this === null || this.length === 0;
    };
    
  3. isNullOrEmptyString(obj)
    function isNullOrEmptyString(obj) {
      if (isNullOrUnderdefined(obj))
        return false;
      if (isStringType(obj)) {
        return obj.length == 0;
      return false;
    
  4. isNullOrWhitespace()
    String.prototype.isNullOrWhitespace = function () {
      return this === null || this.replace(/\s/g, '').length === 0;
    };
    
  5. isNullOrWhitespace(input)
    String.isNullOrWhitespace = function( input ) {
      return !input || !input.trim();
    };
    
  6. isEmpty()
    String.prototype.isEmpty = function() {
        return (this.length === 0 || !this.trim());
    };
    
  7. isEmpty()
    "use strict";
    String.prototype.isEmpty = function() {
        return (this.length === 0 || !this.trim());
    };
    
  8. isEmpty()
    String.prototype.isEmpty = function() {
      return this.length === 0 || !this.trim();
    };
    
  9. isEmpty()
    String.prototype.isEmpty = function() {
        return this == null || this == '';
    };
    RegExp.escape = function(val) {
        return val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
    };