Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardNodeJSworker_threads memory sharingSingle-choice MCQ

You create a Worker and pass a regular ArrayBuffer in the transferList of postMessage(). After the call returns on the main thread, what is the state of that ArrayBuffer on the main thread?

const ab = new ArrayBuffer(1024); worker.postMessage(ab, [ab]); console.log(ab.byteLength); // ?