Typo - mistake in canceling interval function

This commit is contained in:
Mark 2017-11-21 12:30:31 +02:00 committed by GitHub
parent 7bfdc06adb
commit a8ff59e3ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -233,7 +233,7 @@ When a function is passed in `setInterval/setTimeout`, an internal reference is
setTimeout(function() {...}, 100);
```
For `setInterval` the function stays in memory until `cancelInterval` is called.
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.
````