Skip to content

Instantly share code, notes, and snippets.

@EthanJWright
Created October 22, 2016 20:48
Show Gist options
  • Save EthanJWright/5b1cf38d6167b8d28fb75cfaad7c3b4e to your computer and use it in GitHub Desktop.
Save EthanJWright/5b1cf38d6167b8d28fb75cfaad7c3b4e to your computer and use it in GitHub Desktop.
test this jsy
const x = function w(z) {
return ((z > 0) ? 0 : 1);
};
const g = (y) => { return x(y) && y; }
const f = function factorial(n) {
const c = (n === 0) ? 1 : (n * factorial(n - 1));
return c && g(c);
};
const h = function d(i) {
return (i > 100) ? (i / 10) : i;
};
const apply = function(lambda) {
return lambda(lambda(8));
};
console.log(apply(function(x) {
return x * x;
}));
console.log(h(f(10)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment