Skip to content

Instantly share code, notes, and snippets.

@saoudrizwan
Created February 11, 2017 02:39
Show Gist options
  • Save saoudrizwan/3670224b5121d2524821232c39111d78 to your computer and use it in GitHub Desktop.
Save saoudrizwan/3670224b5121d2524821232c39111d78 to your computer and use it in GitHub Desktop.
/// Returns an array containing the results of mapping the given closure
/// over the sequence's elements.
/// - Parameter transform: A mapping closure. `transform` accepts an
/// element of this sequence as its parameter and returns a transformed
/// value of the same or of a different type.
/// - Returns: An array containing the transformed elements of this
/// sequence.
public func map<T>(_ transform: (Element) throws -> T) rethrows -> [T]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment