Created
August 28, 2019 08:22
-
-
Save kitcat-dev/28e32a96ed93d9321272e8de0bd07715 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
const If = foo => arg => foo(arg); | |
const True = arg1 => arg2 => arg1; | |
const False = arg1 => arg2 => arg2; | |
If(True)('one')('two'); // one | |
If(False)('one')('two'); // two |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment