Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardNodeJSasync_hooks execution contextSingle-choice MCQ

An AsyncLocalStore loses its stored value across an await in this code. Why?

const als = new AsyncLocalStorage(); function handler() { als.run({ id: 7 }, () => { doAsync(); }); // doAsync's continuation reads als.getStore() => undefined } async function doAsync() { await Promise.resolve(); console.log(als.getStore()); }