In this blog post, you’ll learn about
- How to merge the values of 2 collections (list, array, buffer etc).
If you want to merge the values of 2 collections so that they can be processed together, here’s how you might do it in Java -
// Now, if I know that the keys and values are of the same length and are in order, I might want to process them together.
However, the following operation can be easily done in Scala using the zip operation.
An extension of the zip operation is the zipWithIndex. The function of this is self-explanatory.
Code. Learn. Explore