Javascript Array actualLength()

Description

Javascript Array actualLength()


//TODO: this better, if possible
Array.prototype.actualLength = function() {
 let value = 0;// ww  w . j a v  a 2s  .c o  m
 for (let entry of this) if (entry !== undefined) value++;
 return value;
};



PreviousNext

Related