Created
July 30, 2015 09:21
-
-
Save jk/e865f9f4b6b73bf1903e to your computer and use it in GitHub Desktop.
Closures and trailing closures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myArray = [1, 2, 3, 4, 5] | |
let longMap = myArray.map({ (number) in | |
return number * 10 | |
}) | |
let convienceMap = myArray.map { number in | |
return number * 10 | |
} | |
let shortMap = myArray.map { $0 * 10 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment