1 comment

[ 3.6 ms ] story [ 10.0 ms ] thread
JavaScript variables are passed by reference, the variable `i` on the statement: `var msg = txt[i];` will always reference the last value after the loop has executed.