Every function in dart is an object.
Functions that we use very often without a name are also called lambda functions.
Lambda functions are also called Arrow functions.
You can see usage example and output below.
Follow my blog for more baransel.dev.
Top comments (3)
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:
Anonymous/lambda function:
Lambda functions are also called Arrow functions.
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 😜