Nodejs Utililty Methods Array Empty Check

List of utility methods to do Array Empty Check

Description

The list of methods to do Array Empty Check are organized into topic(s).

Method

isEmpty()
Array.prototype.isEmpty = function () {
  return this.length === 0
};
Array.prototype.last = function () {
  if (this.length === 0) return null;
  return this[this.length - 1];
};
isEmpty()
Array.prototype.isEmpty = function(){
  return (this.length === 0 );
isEmpty()
Array.prototype.isEmpty = function() {
    return (0 === this.length);
isEmpty()
Array.prototype.isEmpty = function() {
  return this.length == 0;
};
isEmpty()
Array.prototype.isEmpty = function() {
    return this.length == 0;
isEmpty()
Array.prototype.isEmpty = function() { 
  return this.length < 1 
};
isEmpty()
Array.prototype.isEmpty = function () {
    return this.length === 0;
};
isEmpty()
Array.prototype.isEmpty = function() {
  return this.length == 0 ? true : false;
};
is_empty()
Array.prototype.is_empty = function() {
  return is_empty(this);
};