Pipelines
with list fixed from std:collections
with console from std:io
var fruits = list.of({"Apple", "Banana", "Mango", "Kiwi", "Avocado"})
fruits
|> map({x => x.toLower()})
|> filter({x => x.startsWith("a")})
|> forEach(??, {x => console.out(x)})
//As opposed to
forEach({x => console.out(x)}, filter({x => x.startsWith("a")}, map({x => x.toLower()}, fruits)))
//map(lambda, list), filter(lambda, list) and forEach(lambda, list) are static methods from the list class
//Or even
fruits.map({x => x.toLower()}).filter({x => x.startsWith("a")}).forEach({x => console.out(x)})
//map(lambda), filter(lambda) and forEach(lambda) are methods from the list classSource
Pipeline target with only one parameter
Example
Pipeline target with multiple parameters
Example
Pipelines in variable assignment
Example
List functions with pipelines
Last updated