The Javascript BigInt64Array copyWithin()
method copies the sub array.
This method works the same as Array copyWithin()
.
BigInt64Array.copyWithin(target, start[, end = this.length])
Parameter | Optional | Meaning |
---|---|---|
target | Required | Target start index position where to copy the elements to. |
start | Required | Source start index position where to start copying elements from. |
end | Optional | Source end index position where to end copying elements from. |
var buffer = new ArrayBuffer(8); var uint8 = new BigInt64Array(buffer); uint8.set([1n, 2n, 3n]);//from ww w.j a v a 2s .c o m console.log(uint8); // BigInt64Array [ 1n, 2n, 3n, 0, 0, 0, 0, 0 ] uint8.copyWithin(3,0,3); console.log(uint8); // BigInt64Array [ 1n, 2n, 3n, 1n, 2n, 3n, 0, 0 ]