JS Built-ins
SharedArrayBufferintermediate

SharedArrayBuffer β€” ArrayBuffer.isView()

πŸ“– Usage Example
const sab = new SharedArrayBuffer(4)
Atomics.store(new Int32Array(sab), 0, 99)
Atomics.load(new Int32Array(sab), 0)  // β†’ 99

Use Atomics with SharedArrayBuffer for thread-safe read/write operations.

ArrayBuffer.isView()

ArrayBuffer.isView(value) returns true if value is a typed array or DataView backed by an ArrayBuffer or SharedArrayBuffer.

Challenge: Verify that an Int32Array backed by a SharedArrayBuffer passes ArrayBuffer.isView.

πŸ’‘ Hints (1)
  • β€’ ArrayBuffer.isView() returns true for any typed array or DataView, not for the buffer itself.