This library provides a utility function to support the creation of self-referencing anonymous functions.
It can be installed in whichever way you prefer, but I recommend NPM.
var z = ;// Factorialvar factorial =;// => 2// => 6// => 24// => 120
Just as you would with any other recursive function, make sure you include some sort of break condition. If you miss it out, the function will recur indefinitely.
var z = ;0;// => Error: Maximum call stack exceeded0;// => 100
I accept contributions to the source via Pull Request, but passing unit tests must be included before it will be considered for merge.
$ make install$ make tests
If you have Vagrant installed, you can build the dev environment to assist development.
The repository will be mounted in
$ vagrant up$ vagrant sshWelcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)$ cd /srv