a closure can capture either the value or the reference of the variables.
in this case it captured the reference which at the time of invocation always pointed to the same value.
in this case it captured the reference which at the time of invocation always pointed to the same value.