DEV Community

[Comment from a deleted post]
 
myogeshchavan97 profile image
Yogesh Chavan • Edited

You can check out this article to better understand how memory leak can happen when using closures. In filter, map or reduce we provide a callback function as an argument. We don't return a function from a function there.