The author claims that “higher-order function is a function that can be passed into, or returned from, another function”, but as far as I know (and as is also confirmed on page 16 of the same book), a higher-order function is one that operates on another function, taking it as an argument or returning it as a result. So, in this particular example, filter
is the higher-order function, not the isOdd
and isEven
predicates.