JavaScript
Result
Run
License
const arrBuffer = new ArrayBuffer(16, { maxByteLength: 32 }); const uint16view = new Uint16Array(arrBuffer); uint16view[2] = 15; const arrBuffer2 = arrBuffer.transferToFixedLength(); console.log(arrBuffer.detached); console.log(arrBuffer2.resizable); const uint16view2 = new Uint16Array(arrBuffer2); console.log(uint16view2[2]);
Console
expand_less
License
License
by DevDic
Close