I have some javascript code that uses a `for` loop to construct a string. When the code runs, it appears that the number of loop iterations fewer than expected. If I attempt to debug the code by adding `window.alert` statements, the behavior changes and I get the correct number of loop iterations. Has anyone else encountered something like this?