@Bobby_Thomas, there a slight change to how you end loops in the latest version of PsychoPy/JS. To end a loop, use the following. In this example, we end the loop on the 2nd repetition of that current loop:
if (currentLoop.thisRepN == 2)
{
trials.finished = true; // to end any loop, use 'trials'
}