Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScripttyped arrays and ArrayBufferSingle-choice MCQ

An ArrayBuffer is transferred (via structuredClone with transfer, or postMessage). What happens to existing typed array views over it, per the detachment semantics?

const buf = new ArrayBuffer(8); const view = new Uint8Array(buf); view[0] = 9; structuredClone(buf, { transfer: [buf] }); const r = [buf.byteLength, view.length, view[0]];