replace side-effect with side effect
This commit is contained in:
parent
291b5c05b9
commit
4aa9f818e8
10 changed files with 10 additions and 10 deletions
|
@ -232,7 +232,7 @@ setTimeout(function() {...}, 100);
|
|||
|
||||
For `setInterval` the function stays in memory until `clearInterval` is called.
|
||||
|
||||
There's a side-effect. A function references the outer lexical environment, so, while it lives, outer variables live too. They may take much more memory than the function itself. So when we don't need the scheduled function anymore, it's better to cancel it, even if it's very small.
|
||||
There's a side effect. A function references the outer lexical environment, so, while it lives, outer variables live too. They may take much more memory than the function itself. So when we don't need the scheduled function anymore, it's better to cancel it, even if it's very small.
|
||||
````
|
||||
|
||||
## Zero delay setTimeout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue