Prototype: encodeUint32(values) returns a new ArrayBuffer holding every input Number as an unsigned 32-bit little-endian integer. Reject a noninteger, negative, too-large, nonfinite, or non-Number value with RangeError. Preserve the input.
Final: transferBytes(buffer) accepts an ArrayBuffer and returns a Uint8Array over the transferred buffer using structuredClone's transfer mechanism. Preserve all byte values in order; the original buffer must become detached. Do not implement a copying substitute. Empty buffers are valid.
Complete the exported stubs in exercise.mjs. The prototype and final stages have separate checks.
node main.mjs --stage prototype
node main.mjs --stage finalUse Node.js 20+ locally, or the website's browser worker. Tests are standard-library only and check the documented behavior; they do not prove performance or force garbage collection.
Complete the starter code, then run the checks.
Results and errors will appear here.