Let's take a look at how Iterator.scala implements this higher order function exists().
The big advantage is that it now becomes easy to define generic functions to handle certain collection types. Let's see how easy it becomes to write a method that checks if a collection of numbers contains a negative number
As you can see we don't have to write all the boiler plate code of iterating anymore. We just specify the function literal which checks our condition.
Let's test our code with an Array and List, both containing integers.
run:
numbers contains negative number = true
numbers2 contains negative number = false