up
This commit is contained in:
parent
ab9ab64bd5
commit
97c8f22bbb
289 changed files with 195 additions and 172 deletions
|
@ -0,0 +1,15 @@
|
|||
|
||||
Any `setTimeout` will run only after the current code has finished.
|
||||
|
||||
The `i` will be the last one: `100000000`.
|
||||
|
||||
```js run
|
||||
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++;
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue