Great work! Closures are an important tool in Swift that allows you to write and use higher-ordered functions. In this lesson, you learned how to:
- Define closures
- Pass closures to functions
- Use trailing closure syntax and closure syntax sugar
- Call built-in higher-order functions like
- Mark closures as
@escapingso they can be stored for later
- Capture values inside a closure
Using closures and higher-ordered functions can be a great way to make your code more compact and readable!
Feel free to utilize the empty Review.swift file and output terminal on the right to hone your understanding of closures.
Click on “Up Next” when you’re ready to move on.