Why not just use closures (never using functions) or why not just use functions (never using closures)?
Both functions and closures are a way of isolating some functionality, and which may (or may not) take input and may (or may not) return output. In most cases, you will not have to think about “Am I using a function or a closure here?”, as it will all happen behind the scenes. Both functions and closures can be treated as variables and “passed around”. For instance, let’s define a closure and a function:
import Foundation
func function1(string: String, int: Int) -> Data {