Y: The Most Beautiful Idea in Computer Science explained in JavaScript
In this post, we will talk about one of the most beautiful ideas in computer science: the Y-Combinator. And no, I’m not talking about the VC firm in Silicon ...
In this post, we will talk about one of the most beautiful ideas in computer science: the Y-Combinator . And no, I'm not talking about the VC firm in Silicon Valley , even though this post will explain why they've got this name. Put in simple terms, the Y-Combinator (also known as the fixed-point combinator) is a way of doing recursion in a language that does not explicitly supports it . Let's say you want to implement a recursive factorial function . In JavaScript, for example, you could simply do this: const factorial = n => n === 0 ? 1 : n * factorial (n - 1 ); But what if you couldn't use
saved by
related reading
- The Y Combinator (Slight Return): mvanier — LiveJournalmvanier.livejournal.com
- 🙂 Y Combinator for Non-programmersycombinator.chibicode.com
- What the heck is the event loop anyway? | Philip Roberts | JSConf EUyoutube.com
- Understanding useMemo and useCallback • Josh W. Comeaujoshwcomeau.com
- Shikishiki.style
- Get better at programming by learning how things workjvns.ca
- How Not to Teach Recursionparentheticallyspeaking.org
- I never understood this obsession with lambda calculus or ycombinator. If most o... | Hacker Newsnews.ycombinator.com
- What is PLUS times PLUS?youtube.com
- Big Osamwho.dev
- Reading 15: Promisesweb.mit.edu
- How to Apply to Y Combinator | Y Combinatorycombinator.com