0

This is what I have surmised so far: In JavaScript, when we mean a closure, we mean that the variables are closed over and can be accessed even after the main function returns. Whereas in Groovy, a closure is a name given to a block of code that is defined and then executed at a later point.

Is this correct?

Taylor Liss
  • 593
  • 4
  • 27
  • 1
    http://stackoverflow.com/questions/111102/how-do-javascript-closures-work?rq=1 reference here, though it doesn't cover groovy – Sean Kwon Feb 24 '17 at 21:05
  • 1
    no, you are mixed up with global variables. the closure is only access in the nested function, even the globals are a closure. – Nina Scholz Feb 24 '17 at 21:05

0 Answers0