Skip to main content

reduce

method Float16Array.reduce
Jump to headingFloat16Array.reduce(callbackfn: (
previousValue: number,
currentValue: number,
currentIndex: number,
array: Float16Array,
) => number
): number

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

Parameters Jump to heading

Jump to headingcallbackfn: (
previousValue: number,
currentValue: number,
currentIndex: number,
array: Float16Array,
) => number

A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

Return Type Jump to heading

number
Jump to headingFloat16Array.reduce(
callbackfn: (
previousValue: number,
currentValue: number,
currentIndex: number,
array: Float16Array,
) => number
,
initialValue: number,
): number

Parameters Jump to heading

Jump to headingcallbackfn: (
previousValue: number,
currentValue: number,
currentIndex: number,
array: Float16Array,
) => number
Jump to headinginitialValue: number

Return Type Jump to heading

number
Jump to headingFloat16Array.reduce<U>(
callbackfn: (
previousValue: U,
currentValue: number,
currentIndex: number,
array: Float16Array,
) => U
,
initialValue: U,
): U

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

Type Parameters Jump to heading

Parameters Jump to heading

Jump to headingcallbackfn: (
previousValue: U,
currentValue: number,
currentIndex: number,
array: Float16Array,
) => U

A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

Jump to headinginitialValue: U

If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Return Type Jump to heading

Back to top