O'Reilly logo
  • yuchen zhan thinks this is interesting:

But, the callback “captures” the values of addThumbClickHandler’s variables and parameters. The callback uses these captured values when it runs.

From

Cover of Front-End Web Development: The Big Nerd Ranch Guide

Note

Just like the "Block" in Objective-C which captures the outer variables.