Created
January 14, 2015 04:26
-
-
Save alexbosworth/06c7861dc1a2196fdac8 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
/** 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