// Before (function(){ let x = 10; // x not available outside })(); // Now { let x = 10; // x not available outside }
for(let i=0; i<10; i++){ setTimeout(function(){ console.log("number " + i); }, 1000); }
Last updated 4 years ago
Was this helpful?