Float32Array.prototype.copyWithin

Copies a section of the typed array from the start index to the end index into the target index, overwriting the existing array elements starting at the target index. It modifies the original array without resizing it, and returns it.

Syntax

copyWithin(target, start?, end?)

Parameters

Return value

The modified original array.

Examples

new Float32Array([0, 1, 2, 3, 4]).copyWithin(0, 2, 4)
Float32Array [2, 3, 2, 3, 4]