3 ms·
My experience writing Scala was that there's a modest list of ways people iterate over collections that covers 99.9% of cases. For this example, many languages
by cheriot 5y ago
My experience writing Scala was that there's a modest list of ways people iterate over collections that covers 99.9% of cases. For this example, many languages have a Partition function.
matches, mismatches := slices.Partition(xs, func(x whatever) bool { return x == condition })