Last active
August 29, 2015 14:02
-
-
Save terinjokes/28c71e665201d3f97040 to your computer and use it in GitHub Desktop.
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
// anonymous function | |
numbers.map({ | |
(number: Int) -> Int in | |
let result = 3 * number | |
return result | |
}) | |
// implicit return for single statements | |
numbers.map({ number in 3 * number }) | |
// refer to parameters by number | |
sort([1, 5, 3, 12, 2]) { $0 > $1 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment