Skip to content

Commit a8ff59e

Browse files
authored
Typo - mistake in canceling interval function
1 parent 7bfdc06 commit a8ff59e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • 1-js/06-advanced-functions/08-settimeout-setinterval

1-js/06-advanced-functions/08-settimeout-setinterval/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ When a function is passed in `setInterval/setTimeout`, an internal reference is
233233
setTimeout(function() {...}, 100);
234234
```
235235
236-
For `setInterval` the function stays in memory until `cancelInterval` is called.
236+
For `setInterval` the function stays in memory until `clearInterval` is called.
237237
238238
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.
239239
````

0 commit comments

Comments
 (0)