🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators foreach
This page was created by Lars.olofsson on 2021-12-13. Last edited by Edgar on 2025-08-31.

Note: This is an EAL operator

It iterates a collection containing and executing the expression on all elements contained in self.

Expression Result
(list of objects)->forEach(str | str.DoSomething) The method DoSomething is called once on each of the objects in (list of objects)

To iterate and return a list as the result, use collect.