Created
December 1, 2016 14:02
-
-
Save newmanbrad/f6572d336fde04127d4aac250038007b to your computer and use it in GitHub Desktop.
Higher Order Function Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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