what is this gotcha?
-
-
-
In JS this would be like: for (var i = 0; i < n; ++i) { arr[i] = function() { console.log(i); } } All of them would capture i by reference, and print n instead of 0..n-1
- 1 more reply
New conversation -
-
-
last I checked the borrow checker (accidentally) caught induction variable issues?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.