Language suggestion: shorter function declaration with only one parameter and one line expression #36941
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
closed-duplicate
Closed in favor of an existing report
It's just a suggestion for Dart lang, not a bug report. I did not find a way to publish my suggestion, so I file this here.
Arrow functions are good, but it can be shorter when there is only one parameter by using underscore
_
.It can be shorter using underscore
_
without(_) =>
syntax.When an expression using underscore
_
, it returns a function which will take only one parameter and pass it to the express. You can use the same parameter in the expression as many times as you want. It might be useful for functional programming.The text was updated successfully, but these errors were encountered: