Skip to content

Instantly share code, notes, and snippets.

const one = () => 1;
const two = () => 2;
const three = () => 3;
function op(fn) {
return function() {
return (vars) => Array.from(arguments)
.map(x => typeof x === 'function' ? x(vars) : +x).reduce(fn)
};
}