Lambda Filters
Higher Order Filters operate on a list of items and process a Lambda individually for each item. The Lambda has access to several context variables that represent various states of the iteration process. Details of each of these context variables are mentioned below.map
- $this - the context variable that represents the element of the array being processed.
- $index - the context variable that represents the numerical index of the element of the array being processed
- $parent - the context variable that represents the entire array with all of its elements.




some
- $this - the context variable that represents the element of the array being processed.
- $index - the context variable that represents the numerical index of the element of the array being processed.
- $parent - the context variable that represents the entire array with all of its elements.


every
- $this - the context variable that represents the element of the array being processed.
- $index - the context variable that represents the numerical index of the element of the array being processed.
- $parent - the context variable that represents the entire array with all of its elements.

find
- $this - the context variable that represents the element of the array being processed.
- $index - the context variable that represents the numerical index of the element of the array being processed.
- $parent - the context variable that represents the entire array with all of its elements.

findIndex
- $this - the context variable that represents the element of the array being processed.
- $index - the context variable that represents the numerical index of the element of the array being processed.
- $parent - the context variable that represents the entire array with all of its elements.

filter
- $this - the context variable that represents the element of the array being processed.
- $index - the context variable that represents the numerical index of the element of the array being processed.
- $parent - the context variable that represents the entire array with all of its elements.

reduce
- $this - the context variable that represents the element of the array being processed.
- $index - the context variable that represents the numerical index of the element of the array being processed.
- $parent - the context variable that represents the entire array with all of its elements.
- $result - the context variable that is used to represent the result of the previous iteration or the initial value on the first iteration.
$result which can be referenced. The $result variable is the state of the reduction process. The first time the Lambda runs, the $result variable is the same as the initial variable. The return statement of the Lambda will be the $result variable for the 2nd iteration and so forth until there are no iterations left. The final value of the $result variable will be assigned to whatever is referencing the reduce filter.
The details above may feel like a mouthful, but things should start to click when seeing a few examples.
The most basic example would be sum a list of values.



