Skip to main content

All Questions

3 votes
2 answers
211 views

What is the most idiomatic way to iterate collection with different action for first element?

Sometimes we meet a situation where we should iterate (or map) over a collection, applying the same procedure (function) for all elements except the first one. The simplest example is finding the max ...
ov7a's user avatar
  • 141