Skip to content

Instantly share code, notes, and snippets.

@kitcat-dev
Created August 28, 2019 08:22
Show Gist options
  • Save kitcat-dev/28e32a96ed93d9321272e8de0bd07715 to your computer and use it in GitHub Desktop.
Save kitcat-dev/28e32a96ed93d9321272e8de0bd07715 to your computer and use it in GitHub Desktop.
Каррирование функции
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