Skip to content

Instantly share code, notes, and snippets.

@newmanbrad
Created December 1, 2016 14:02
Show Gist options
  • Select an option

  • Save newmanbrad/f6572d336fde04127d4aac250038007b to your computer and use it in GitHub Desktop.

Select an option

Save newmanbrad/f6572d336fde04127d4aac250038007b to your computer and use it in GitHub Desktop.
Higher Order Function Example
// Because the applyOperation function accepts a function as an argument, it is
// considered a higher order function.
function applyOperation(a, b, opt) {
return opt(a, b);
}
let multiplier = (a, b) => a * b;
applyOperation(2, 3, mulptiplier); // 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment