Javascript Array reduceRight2(pasteback, initial)

Description

Javascript Array reduceRight2(pasteback, initial)

Array.prototype.reduceRight2 = function(pasteback, initial){
 for(var i = this.length
    , value = arguments.length>1 ? initial : this[--i]
 ; i--;){/*from   ww  w  . ja  va2s. co m*/
  value = pasteback(value, this[i], i, this);
 }
 return value;
};



PreviousNext

Related