There was an error while loading. Please reload this page.
Lambdas are syntactic sugar for in-place delegates.
|PARAMETERS| { DELEGATE_FUNCTION_SCOPE }
Example:
var items = [1,2,3,4,5,2,3,4,5,3,4,5,4,5,5]; var only5s = items.filter(|item| { return item == 5; }).array;
Same as:
var items = [1,2,3,4,5,2,3,4,5,3,4,5,4,5,5]; fn bool filterFn(int item) { return item == 5; } var only5s = items.filter(filterFn).array;