Skip to content

Commit

Permalink
Typo - mistake in canceling interval function
Browse files Browse the repository at this point in the history
  • Loading branch information
TMatrix authored Nov 21, 2017
1 parent 7bfdc06 commit a8ff59e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
````
Expand Down

0 comments on commit a8ff59e

Please sign in to comment.