diff --git a/1-js/06-advanced-functions/08-settimeout-setinterval/article.md b/1-js/06-advanced-functions/08-settimeout-setinterval/article.md index cc347aae..e52feac7 100644 --- a/1-js/06-advanced-functions/08-settimeout-setinterval/article.md +++ b/1-js/06-advanced-functions/08-settimeout-setinterval/article.md @@ -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. ````