Created
June 19, 2019 15:34
-
-
Save h09shais/234b3a2bfa04be49aeaa54f4d2bc4b6c to your computer and use it in GitHub Desktop.
Higher order function
This file contains 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
const add = (x, y) => x + y | |
add(1,3) | |
const createAdder = (a) => (b) => add(a, b) // Higher order function | |
const add2 = createAdder(3) | |
add2(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment