DEV Community

Discussion on: Lambda Functions in Dart

Collapse
 
nombrekeff profile image
Keff

Just wanted to clear something up. What is showcased in the example are not lambdas/anonymous functions, they are arrow functions. Although lambdas usually use the arrow syntax.

Arrow syntax function:

int test() => 123;
Enter fullscreen mode Exit fullscreen mode

Anonymous/lambda function:

items.map((item) => item.value);
Enter fullscreen mode Exit fullscreen mode
Collapse
 
baransel profile image
Baransel • Edited

Lambda functions are also called Arrow functions.

Collapse
 
nombrekeff profile image
Keff

Correct, lambdas use the arrow syntax, but at least in dart they only refer to anonymous/closure functions as lambdas. I've not seen arrow functions refered as such, at least in the dart language. Though they're called that in some other languages.

PD: no need to scream 😜