Last active
January 28, 2017 12:20
-
-
Save komkanit/9f5404daf5e9420e874b61b389c2f203 to your computer and use it in GitHub Desktop.
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
| const add = (x, y) => x + y | |
| const minus = (x, y) => x - y | |
| const logSomeThing = (func) => (...args) => { | |
| console.log(func(...args)) | |
| } | |
| const logAdd = logSomeThing(add) | |
| const logMinus = logSomeThing(minus) | |
| logAdd(20, 5) // 25 | |
| logMinus(10, 3) // 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment