Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
extension Array{
func every(fn: (T)->Bool) -> Bool{
var out = true
for i in self {
out = out && fn(i);
}
return out
}
func some(fn: (T) -> Bool) -> Bool{
var out = false
for i in self {
out = out || fn(i);
}
return out
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.