Skip to content

Instantly share code, notes, and snippets.

View rkrupinski's full-sized avatar
🤷‍♂️

Rafał Krupiński rkrupinski

🤷‍♂️
View GitHub Profile
@rkrupinski
rkrupinski / curry.js
Created October 7, 2016 06:05
Currying with generators
function* curryGen(fn) {
const l = fn.length;
const args = [];
while (true) {
if (args.length < l) {
args.push(...yield);
} else {
return fn(...args);
}