subarrayintermediateconst arr = new Int32Array([1, 2, 3, 4, 5]);
const sub = arr.subarray(1, 3);
// Int32Array [2, 3] (same underlying buffer)subarray() returns a view of a portion without copying the underlying buffer.
Use subarray() to get a view of a portion of a typed array without copying.