GitbookIO/javascript

is 'Higher Order Functions' as the same as 'javascript closure'?

ldong opened this issue · 2 comments

In 6.2 Higher Order Functions, could you tell the difference compare to javascript closure?

For me this so called 'Higher order functions' is exactly how I understand 'closure'. If I'm right, please add 'this is what other people called closure' at the end of this section. It surely will clarify the misunderstanding.

@SamyPesse @AaronO Thank you

In JS, Higher Order Functions are also known as Callbacks. Concept of closures is different.

Higher Order Functions are functions that either takes function as an argument or returns function and closure is a different concept. so what is closure ? -- closure is a power of inner function where it is able to access variables from outer function even after the outer function is returned.