DEV Community 👩‍💻👨‍💻

Discussion on: Tricky JavaScript Questions

ninjasun profile image

Hi, on number 3 I do not think definition of clousure is correct. Because a closure is not a function that return another function. As per your example is the variable value that gets a reference to param 2. So the variable get close inside the scope and by that the function cant return. In your example the closure refers to value.

tomeraitz profile image
Tomer Raitz Author

I'm not sure you are correct, And I didn't understand completely what you mean. But, I think we say the same thing. I believe it doesn't matter if you know the exact definition of closure "by the book", the most important thing it's to understand the concept.