The reduceLeft method takes an associative binary operator function as parameter and will use it to collapse elements from the collection. The order for traversing the elements in the collection is from left to right and hence the name reduceLeft. Unlike the foldLeft method, reduceLeft does not allow you to also specify an initial value.
As per the Scala documentation, the definition of the reduceLeft method is as follows:
def reduceLeft[B >: A](op: (B, A) ⇒ B): B
The reduce operation takes all the elements in a collection and combines them in some way to produce a single value. It uses a binary operation to combine the first two values. Then, it takes the result of that first combination and combines it with the next element in the collection, and then the next, and so on through the end of the collection.
The code looks like this:
![image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA2MTkwNzcwNiwiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.U5pvcG5pv8y2pXm4l-yfstUX3U3Do-FXkNJf4RInhSI)