Int8Array.prototype.reduce

Calls a function for all the elements in a typed array. The return value of the function is the accumulated result, and is provided as an argument in the next call to the callback function.

Syntax

reduce(callback, initialValue?)

Parameters

Return value

The accumulated result.

Example

new Int8Array([1, 2, 3]).reduce((sum, value) => sum + value, 0)
6

See also