
We have used forEachIndexed this gives the extracted value at the index and. exitASAP (optional, default true): if true, the condition will be evaluated for each element inside the loop, possibly causing to exit the loop before reaching the end of the iteration. .forEach(operation: (T) -> Unit): This performs the given operation on each.fun ByteArray.forEachIndexed( action: (index: Int, Byte) -> Unit).

You can also iterate a map using the keys property, which returns a. Performs the given action on each element, providing sequential index with the element. You can iterate a map using the entries property, which returns a set of key/value pairs in the map. A simple solution is to use a foreach loop for iteration through collections.


condition: can be a boolean, a Gatling EL String resolving a boolean or a function.
Iterate over the loop as long as the condition is satisfied. forEach - Kotlin Programming Language Common JVM JS Native Version 1.8 kotlin-stdlib / llections / forEach forEach Common JVM JS Native 1.0 inline fun