Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Odd Async Behavior

node v10.24.1
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