Javascript Array empty()
Array.prototype.empty = function () { return this.length === 0; };
Array.prototype.empty = function () { return(this.size() < 1) }
Array.prototype.empty = function () { return !(this.length > 0) };
Array.prototype.empty = function() { return this.length == 0; }
/**/*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; };
// 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; }
// Do not extend built-in prototypes // Bad example// www .j av a 2 s .co m Array.prototype.empty = function() { return !this.length; }