Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created August 5, 2018 19:34
Show Gist options
  • Save vialyx/e6588aa068b2407f4e019cb27cc6e25d to your computer and use it in GitHub Desktop.
Save vialyx/e6588aa068b2407f4e019cb27cc6e25d to your computer and use it in GitHub Desktop.
let integers = [1, 2, 3, 4, 5]
/*
Inferring Type From Context
Compile already know the result is String array
*/
/*
Implicit Returns from Single-Expression Closures
Just String($0)
*/
/*
Shorthand Argument Names
Just $0
*/
let result = integers.map { String($0) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment