Odd Async Behavior

node v10.16.3
version: 0.0.1
endpointsharetweet
let max = Array.apply(null, Array(10)).map(function() { return 0 }); console.log(max); console.log("Beginning async test"); let success = (async () => { console.log("In anonymous async function"); for (let i in max) { console.log(max) max[i] = i+1; await setTimeout(() => {console.log(`${i+1} seconds have passed`);}, 1000); } return true; })(); console.log(`value of success: ${success}`); console.log("Last");
Loading…

no comments

    sign in to comment