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

@am8302 are you running an older version of PsychoPy ? Looks like 3.2, so I would suggest updating to the latest version which will have the latests fixes in place.