Skip to content

Instantly share code, notes, and snippets.

View nicolo-ribaudo's full-sized avatar

Nicolò Ribaudo nicolo-ribaudo

View GitHub Profile
@nicolo-ribaudo
nicolo-ribaudo / y.js
Last active September 30, 2015 14:36
JS Y-combinator
const Y = a=>(a=>a(a))(b=>a((...a)=>b(b)(...a)));
// Usage
/*
* var result = Y((the function itself) => (...parameters) => {
* return result;
* })(...parameters);
*
*/