Higher order functions

Val salaries = Seq(20000, 70000, 40000)
val doubleSalary = (x: Int) => x * 2
val newSalaries = salaries.map(doubleSalary) // List(40000, 140000, 80000)

Take other functions as parameters or return a function as a result.

Higher order functions → are a → Functions.

Higher order functions — Structure map

Clickable & Draggable!

Higher order functions — Related pages: