What the hell is a closure? Before JS inside heard some, but the actual development how do not feel how to use this concept? Just recently when learning laraval, found that the routing configuration is the closure function (the tutorial said that), do not understand what this closure means? I see the code and JS inside the anonymous function is very similar AH? Thank you for answering ﹏.
Reply content:
What the hell is a closure? Before JS inside heard some, but the actual development how do not feel how to use this concept? Just recently when learning laraval, found that the routing configuration is the closure function (the tutorial said that), do not understand what this closure means? I see the code and JS inside the anonymous function is very similar AH? Thank you for answering ﹏.
Closures are a free block of code, in most language closures, basically in the form of anonymous functions, in PHP and JS can be interpreted as a closure of anonymous functions, the two are consistent. Of course, in PHP, there are also closure objects to operate closures.