We can pass a function in the form of a literal to another function, to work for us. Let's take the same compareIntegers function example:
def compareIntegersV6(value1: Int = 10, value2: Int): Int = ???
We know what our function is supposed to do: take two integer numbers as input and return an integer response telling us the result of our comparison. If we take a look at the abstract form of our function, it will look like this:
(value1: Int, value2: Int) => Int
This means that the function is expecting two integers, and returning an integer response; our need is the same. It's an abstract form that indicates that elements on the left are inputs and elements on the right are the response type for our function. We can say that this is in its literal form, also called function literals. Hence, it's also possible to assign this...