How to execute javascript for each item in a repeat?

formatters are essentially Javascript functions that run on values to convert them (such as formatDate(), .sort(), .trim() etc.). You can create your own with the function you have written.

Then you could apply a .setlc() formatter, using your code, to the values which would return the true/false/other value you have coming back from the formatter.

The only consideration is if it matters that it keeps evaluating over and over. Formatters run over and over to apply the format to any updated value. @mebeingken and @patrick were looking at limiting execution if you just wanted to run it when the value was updated: