2. Whats are high order functions?
• One or more of its parameters is a function, and it returns
some value.
• It returns a function, but none of its parameters is a
function.
• One or more of its parameters is a function, and it returns
a function.
3. • def isEqualToFour(a:Int) = a == 4
• val list = List(1, 2, 3, 4)
• val resultExists4 = list.exists(isEqualToFour)
5. Advantages
• Higher-order functions reduce program size and
accelerate development speed, particularly for large
programs.
• Expressiveness of a visual syntax
• Zero run-time cost in most cases