untitled notebook

node v18.11.0
version: 1.0.0
endpointsharetweet
let a = null; const sleep = async (ms) => { return new Promise(resolve => setTimeout(resolve, ms)); } const fn = async () => { await sleep(100); // imagine this was a grpc call or db call etc a = "important" } fn(); // run again but prepend this line with "await" console.log(`The important data is ${a} ${a === null ? '🚨🚨🚨🚨' : ''}`);
Loading…

no comments

    sign in to comment