by hellofunk · 10y ago · 0 comments
JavaScript also closes over variables, so it's not just "obscure" languages that behave this way.
Java only allows you to close over variables that are effectively final, to remove confusion on both sides (e.g. why doesn't the value in my closure change when I manipulate the original variable? vs. why does my the value in my closure change when I manipulate the original variable?)