Javascript Array toStringNew()

Description

Javascript Array toStringNew()


Array.prototype.toStringNew = function () {
  var result = '';
  var re = /,$/;/*from   w  ww  . ja va  2s  .  c om*/

  for (var i = 0; i < this.length; i++) {
    if (this[i] === null || typeof this[i] === 'function') {
      continue;
    }
    result = result.concat(this[i],',');
  }
  return result.replace(re, '');
};



PreviousNext

Related