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

Two typed arrays share one underlying ArrayBuffer with overlapping ranges, and you write through one then read the other. What does this reveal about how typed arrays relate to the buffer's bytes?

const buf = new ArrayBuffer(4); const u8 = new Uint8Array(buf); const i32 = new Int32Array(buf); u8[0] = 0xff; u8[1] = 0xff; u8[2] = 0xff; u8[3] = 0x7f; const r = i32[0];