How to exit loop after certain number of trials with JavaScript?

Hi David,

Thanks for the quick response!

Here’s the code snippet I’m trying to run.

        if (Clicked__Next.status == PsychoJS.Status.FINISHED) {
            LoopName.finished = true;
            continueRoutine = false;
        }

When users click the Next button, it briefly changes colour (0.30ms) just to give some user feedback. Once that’s finished, the routine ends and we go to the next page. I have that working fine in JS throughout all my exp, it’s just getting out of the loop I can’t get working…