3 ms·
They’re useful because they let you pass a slice or map to something built to handle the new func(func (…) bool) style iterators. If I create a IterateOver(fn
by sakjur 2y ago
They’re useful because they let you pass a slice or map to something built to handle the new func(func (…) bool) style iterators.
If I create a IterateOver(fn func(func (K, V any) bool)) function, you cannot pass a slice since that doesn’t match fn’s type, but if you wrap it with slices.All it’ll work.