Skip to Main Content
Dart in Action
book

Dart in Action

by Chris Buckett
January 2013
Beginner content levelBeginner
424 pages
13h 26m
English
Manning Publications
Content preview from Dart in Action

Chapter 4. Functional first-class functions and closures

This chapter covers

  • Declaring functions and return types
  • Specifying mandatory and optional parameters
  • Storing first-class functions in variables
  • Using functions as closures

Dart is similar in many ways to languages such as Java and C#, but its function syntax is more similar to that found in JavaScript than in more strongly typed languages. In Dart, everything is an object, including functions, which means you can store a function in a variable and pass it around your application the same way that you might pass a String, an int, or any other object. This is known as having first-class functions, because they’re treated as equivalent to other types and aren’t second-class citizens ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Dart: Up and Running

Dart: Up and Running

Kathy Walrath, Seth Ladd
Dart: Scalable Application Development

Dart: Scalable Application Development

Davy Mitchell, Sergey Akopkokhyants, Ivo Balbaert
Web Programming with Dart

Web Programming with Dart

Moises Belchin, Patricia Juberias

Publisher Resources

ISBN: 9781617290862Publisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link