Overview

		
			function yCombinator(recFunc) {
				function recursion(func) {
					return func(func)
				}
				
				function pseudo(func) {
					return recFunc((...arg) => {
						return func(func)(...arg)
					})
				}
				
				return recursion(pseudo)
			}
		
	

Before we get into how to build the Y-Combinator, let's start with an overview of what it is, and why it is necessary.

The Applicative-Order Y-Combinator is a way to build recursion (the style of calling a function from within its own definition) into a language that does not internally support. While it is common place for languages to support recursion from very early on their lives (JavaScript included) it is not allowed in strict functional programming, nor is it supported in lambda calculus. As a result, this function and programming style grew out of a need to use recursion in order to build many operations that are exponentially more difficult, or impossible in some cases, without the ability to recursively call a function.

Next