Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumNodeJSWorker threads basicsSingle-choice MCQ

Main thread does worker.postMessage(ab, [ab]) where ab is an ArrayBuffer, listing it in the transfer list. What is ab.byteLength in the main thread afterward?

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