code non-compatible with clarification drawing
in clarification drawing(setinterval-interval.svg) func is calling with different argument values like func(1), func(2) ... But we can't see why variable i changing. Maybe we need func(i++) to explain this situation.
This commit is contained in:
parent
601d9583f7
commit
aecf899602
1 changed files with 2 additions and 2 deletions
|
@ -184,7 +184,7 @@ Let's compare two code fragments. The first one uses `setInterval`:
|
||||||
```js
|
```js
|
||||||
let i = 1;
|
let i = 1;
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
func(i);
|
func(i++);
|
||||||
}, 100);
|
}, 100);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ setTimeout(function run() {
|
||||||
}, 100);
|
}, 100);
|
||||||
```
|
```
|
||||||
|
|
||||||
For `setInterval` the internal scheduler will run `func(i)` every 100ms:
|
For `setInterval` the internal scheduler will run `func(i++)` every 100ms:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue