Skip to content

Instantly share code, notes, and snippets.

@alexbosworth
Created January 14, 2015 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexbosworth/06c7861dc1a2196fdac8 to your computer and use it in GitHub Desktop.
Save alexbosworth/06c7861dc1a2196fdac8 to your computer and use it in GitHub Desktop.
/** Determine if value is present in array
*/
func contains<T: Equatable>(array: [T], element: T) -> Bool {
for elem in array { if elem == element { return true } }
return false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment