Javascript Array empty()

Description

Javascript Array empty()

Array.prototype.empty = function () {
    return this.length === 0;
};

Javascript Array empty()

Array.prototype.empty = function () {
  return(this.size() < 1) }

Javascript Array empty()

Array.prototype.empty = function () {
  return !(this.length > 0)
};

Javascript Array empty()

Array.prototype.empty = function() {
  return this.length == 0;
}

Javascript Array empty()

/**/*w  ww .j  a  v  a  2 s.com*/
@Name: Array.prototype.empty
@Author: Paul Visco
@Version: 1.1 11/19/07
@Description: empties an array
@Return: returns the array emptied
@Example:
myArray.empty();
*/
Array.prototype.empty = function(){
 this.length =0;
 return this;
};

Javascript Array empty()

// Empty (array)// w w w.  j  a va  2s .c  o  m
// -------------
// Determines whether array is empty
Array.prototype.empty = function() {
  return this.length <= 0;
}

Javascript Array empty()

// Do not extend built-in prototypes
// Bad example//  www .j av a 2 s  .co  m
Array.prototype.empty = function() {
    return !this.length;
}



PreviousNext

Related