3 ms·
Every language with mutable variables and closures that I've used works the same way (other than ones like C++ where you have to explicitly capture by either re
by plorkyeran 14y ago
Every language with mutable variables and closures that I've used works the same way (other than ones like C++ where you have to explicitly capture by either reference or value). The behavior can be a bit confusing, but it makes perfect sense once you realize that closures are capturing variables, not values.