Map, filter, reduce
Last updated
Was this helpful?
Last updated
Was this helpful?
The functions in the module can be used for functional-style transformation of data structures. , for example, takes in a list and a function handler, and applies the function to every item in the list, returning a new list of transformed values. This is a convenient way of performing arbitrary transformations on items in lists.
The module contains a set of these functions that operate on lists using handler functions that, when chained together, can be used to perform a variety of transformations.
The most important ones are
- used to transform each item into new items
- used to filter out items in the list that don't pass some criterion
- used to reduce a list into a single item, like for example summing up a list of numbers
- used to find a specific item that matches some criterion
One can assign an anonymous function to the handler property by clicking the f-icon that appears when hovering the property of certain functions, like the ones in the namespace. Read more about anonymous functions .