| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin | [Back] [Original] |
Get to know MDN better
const uint8 = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
//
uint8.copyWithin(3, 1, 3);
console.log(uint8);
// : Uint8Array [1, 2, 3, 2, 3, 6, 7, 8]
copyWithin(target, start)
copyWithin(target, start, end)
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer);
uint8.set([1, 2, 3]);
console.log(uint8); // Uint8Array [ 1, 2, 3, 0, 0, 0, 0, 0 ]
uint8.copyWithin(3, 0, 3);
console.log(uint8); // Uint8Array [ 1, 2, 3, 1, 2, 3, 0, 0 ]
| ECMAScript 2027 LanguageSpecification # sec-%typedarray%.prototype.copywithin |
| Web Proxy Viewer | New URL | Original Page |