I am new to Scala
and trying to explore more in the functional approach.
I have written a method and define a variable like this:-
val list = 1 to 10 toList
def getFilterList(list: List[Int],f:Int => Boolean): List[Int] = {
list.filter(f)
}
getFilterList(list, x => x %2 ==0)
val oddHOF :Int => Boolean = value => value % 2 == 0
list.filter(oddHOF)
Now, my Question is that, is both oddHOF
and getFilterList
are higher order function if not then what oddHOF
and getFilterList
be called ?