js-util

Home > rc-js-util > ATypedArrayTuple > map

ATypedArrayTuple.map() method

Calls a defined callback function on each element of an array, and returns an array that contains the results.

Signature:

map(_callbackfn: (value: number, index: TExtractIndexes<this>, array: this) => number, _thisArg?: unknown): this;

Parameters

Parameter Type Description
_callbackfn (value: number, index: TExtractIndexes<this>, array: this) => number A function that accepts up to three arguments. The map method calls the _callbackfn function one time for each element in the array.
_thisArg unknown (Optional) An object to which the this keyword can refer in the _callbackfn function. If _thisArg is omitted, undefined is used as the this value.

Returns:

this