The c variable declaration is inside the inner most for loop. It's re-declared with every iteration, so every closure has it's own c.
EDIT:
If you declare c inside the anonymous function it will still be 12 in the moment of call (because it will evaluate in that moment)
Last edited by Harven : 05/01/14 at 06:19 AM.
|