Created
December 25, 2022 05:30
-
-
Save thmain/14f8b8543c0aa9893fb3e714696e6450 to your computer and use it in GitHub Desktop.
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
function add10 (a) { | |
return a + 10 | |
} | |
function compound (f) { | |
return function (b) { | |
return f(f(b)) | |
} | |
} | |
console.log( add10(10) ) // 20 | |
console.log( compound(add10)(10) ) // 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment