No Let, No Rec, No Problem: A Gentler Introduction to the Y and Z Combinators Let’s try to solve a simple enough puzzle in JavaScript: You have to write a function fact(n) which calculates the factorial of a number n , but you can not use loops ( for , while , etc), recursion, or even declarations ( let , const , etc). We start with a canonical recursive non-solution to know what we're aiming for, in terms of behaviour: function fact(n) { if (n === 0) { return 1 } else { return n * fact(n - 1) } } This is a non-solution because we can not use recursion, which means we can not call the function fact from inside the definition of the function fact . So, running for loops or calling fact from itself is not allowed. Then, what should we do? Can we call fact from some other function and try to arrive at the same behaviour?…