Array expression to iterate over.
Must be an expression that evaluates to an array containing business entities or data that requires individual element processing. Often references collections captured from API operations or constructed arrays for testing.
Each element in the array will be passed to the function for processing. The array can contain any type of business data appropriate for the intended operation.
Examples:
Business context: Represents collections where each element needs individual attention, such as validation, logging, or side-effect operations that don't transform the data but perform actions based on each element's properties.
Arrow function executed for each array element.
Called once for each element in the array. Should contain operations that process the individual element, such as validation calls, logging operations, or other side effects relevant to the business scenario.
The function parameter represents the current array element and can be used to access properties and perform element-specific operations.
Type discriminator.
Array forEach expression for iterating over elements with side effects.
Executes a function for each array element without returning a new array. Used for performing operations on each element such as validation, logging, or side-effect operations that don't require collecting results.
E2E testing scenarios:
Note: Use when you need to process each element but don't need to transform or collect results. For transformations, use IArrayMapExpression.
AI function calling strategy: Use for validation operations or side effects on each element of captured data collections, especially when the operation doesn't produce a new collection.