Higher-Order Function
say it: “HY-er OR-der FUNGK-shun” /ˈhaɪər ˈɔrdər ˈfʌŋkʃən/
A function that takes another function as a value, or hands one back.
What is a higher-order function?
A higher-order function takes another function as a value, or returns one. A checkout that's handed this week's deal as a function, and calls it to work out the discount, is one; so is sort when you hand it a function that compares two items.
function checkout(order, deal) {
return order.subtotal - deal(order);
}
Level: Journeyman · More Software Development terms at this level
Updated