DEV Community

Discussion on: 2 Examples To Help You Understand JS Closures Once And For All 🙃

Collapse
 
devworkssimone profile image
DevWorksSimone • Edited

Yes, after reading your explanation I get where I was failing. You are assigning getNextNumber variable the getNext() function, not the return of it, or for better day you are assigning the return of createCount() function which is in fact getNext() function. Thanks to pointing that for it to become as I thought, it need to be assined just as createCounter (no brackets) instaed of createCounter(). Hope may help somebody like me who failed to grasp it 😁. Thanks again