December 2015
Beginner to intermediate
224 pages
6h 52m
English
Functions are the workhorse of Dart. It is functions that actually compute things. We use the term functions loosely to cover functions and methods of all syntactic forms, regardless of whether they behave as mathematical functions or not.
Functions in Dart are first class values that can be stored in variables, passed as parameters and returned as results. Like all runtime values in Dart, functions are objects.
We have already encountered a variety of functions: top-level functions, instance and class methods (be they getters, setters, operators or vanilla methods) and constructors. As we shall see, there are also local functions and function literals. They all share common structure which we will illustrate here.
Read now
Unlock full access