en.javascript.info/1-js/8-more-functions/5-settimeout-setinterval/4-settimeout-result/solution.md
Ilya Kantor d4c714cbe1 work
2016-08-05 16:53:08 +03:00

293 B

Any setTimeout will run only after the current code has finished.

The i will be the last one: 100000000.

let i = 0;

setTimeout(() => alert(i), 100); // 100000000

// assume that the time to execute this function is >100ms
for(let j = 0; j < 100000000; j++) {
  i++; 
}