replace side-effect with side effect

This commit is contained in:
Lavrentiy Rubtsov 2022-04-25 23:11:54 +06:00 committed by GitHub
parent 291b5c05b9
commit 4aa9f818e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 10 additions and 10 deletions

View file

@ -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