Return to site

Reduce in javascript

broken image
broken image

If no initial value is supplied, the last element in the array will be used and skipped. Value to use as accumulator to the first call of the callbackFn.

broken image

On the first call, its value is array.length - 1 if initialValue is specified, otherwise array.length - 2. The index position of currentValue in the array. On the first call, its value is the last element if initialValue is specified otherwise its value is the second-to-last element. On the first call, its value is initialValue if the latter is specified otherwise its value is the last element of the array. The value resulting from the previous call to callbackFn. The function is called with the following arguments: accumulator For the last invocation, the return value becomes the return value of reduceRight(). Its return value becomes the value of the accumulator parameter on the next invocation of callbackFn. ()Ī function to execute for each element in the array.Object.prototype._lookupSetter_() Deprecated.Object.prototype._lookupGetter_() Deprecated.Object.prototype._defineSetter_() Deprecated.

broken image

broken image