Skip to content

Instantly share code, notes, and snippets.

@jarsen
Created June 3, 2014 19:34
Show Gist options
  • Save jarsen/4a4674b8b7ac1781a988 to your computer and use it in GitHub Desktop.
Save jarsen/4a4674b8b7ac1781a988 to your computer and use it in GitHub Desktop.
extension Array {
func each (block : (T) -> ()) {
for item in self {
block(item)
}
}
}
animals.each(println)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment