Swift Combine: min() & max() operator

In this article, I’m going to cover sequence operators. The sequence operators are very easy to understand because the publisher itself is the sequence itself. So sequence operator works usually on the collection like an array or a set and they are finite sequences. You must know that sequence operators like min() and max() works only on the collection with a limited amount.

min()

When you use min() operator, you can probably guess what’s going to happen. What you receive is the minimum value from the collection.

max()

When using max() operator, you are right. You will get the maximum value from the array.

Conclusion

  • Sequence operator only works with finite collections.
  • min() sinks the minimum value from the collection.
  • max() sinks the maximum value from the collection.

--

--

Software Engineer, Mobile Developer living in Seoul. I hate people using difficult words. Why not using simple words? Keep It Simple Stupid!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
KD Knowledge Diet

Software Engineer, Mobile Developer living in Seoul. I hate people using difficult words. Why not using simple words? Keep It Simple Stupid!