Understanding shorthand closure syntax for map function in Swift
问题 I'm trying to understand some of the short hand syntax used by the map function. The following is the setup let array = [1, 2, 3] // these make sense let arr1 = array.map({String($0)}) let arr2 = array.map{String($0)} let arr3 = array.map({ number in return String(number) }) let arr4 = array.map({ (number) -> String in String(number) }) Here is where the confusion lays. In swift I can forgo the curly braces for map, but this seems like something that can't be done, for my own functions where