| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice | [Back] [Original] |
Get to know MDN better
const bytes = new Uint8Array([10, 20, 30, 40, 50]);
const byteSlice = bytes.slice(1, 3);
console.log(byteSlice);
// : Uint8Array [20, 30]
slice()
slice(start)
slice(start, end)
const bytes = new Uint8Array([1, 2, 3]);
bytes.slice(1); // Uint8Array [ 2, 3 ]
bytes.slice(2); // Uint8Array [ 3 ]
bytes.slice(-2); // Uint8Array [ 2, 3 ]
bytes.slice(0, 1); // Uint8Array [ 1 ]
| ECMAScript 2027 LanguageSpecification # sec-%typedarray%.prototype.slice |
| Web Proxy Viewer | New URL | Original Page |