Swift supports anonymous functions, which can form closures. Anonymous functions are useful when you want to define a function inline without having to name it.
To run the program, save it as a .swift file and use the Swift compiler:
The last feature of functions we’ll look at for now is recursion.