stkent
12/04/2017, 7:52 PMfor (element in this) if (!predicate(element)) return false
return true
says "if any element does not match the predicate, return false; otherwise, return true".
Second version:
return this.any { predicate(it) }
says "if any element matches the predicate, return true; otherwise, return false".
These are not equivalent, right?