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

A worker throws an uncaught synchronous exception at the top of its module. On the main thread holding the `Worker` instance, what happens?

const { Worker, isMainThread } = require('worker_threads'); if (isMainThread) { const w = new Worker(__filename); w.on('error', e => console.log('error', e.message)); w.on('exit', c => console.log('exit', c)); } else { throw new Error('boom'); }