This is clearly not appears like it wouldn\'t be a best practice. Can someone explain why it would not be a best practice or how this works? Any books or ar
You need to capture the value of the variable within the closure/delegate, else it can be modified, like you saw.
Assign currentValue to a variable local (inside) to the delegate.