PsychoJS trialHandler commands - a few questions

I am trying to understand whether it is possible to use one of the commands of PsychoJS trialHandler to return info about the number of trials presented and/or remaining. In reference to the git documentation, I think a couple of commands may be of use: getCurrentTrial, getEarlierTrial, getFutureTrial, getTrialIndex, but I can’t figure how (1) what does each of them actually do and (2) how to use them in the Code Component.

Basically, what I would like to do is refer to the total number of trials and present a break when half of the total number of trials has been presented.

Does anyone know whether this is at all possible at the stage of development?

Those functions allow you to find out the condition values for a future trial (e.g. know the word/ink colour of a future trial in the stroop). They don’t tell you then number of trials remaining/completed. Those come from various TrialHandler attributes listed in the library below, as in the Python TrialHandler:

I am sorry, I only check the documentation page and not the script. This topic can be deleted and we continue the discussion in my previous post.