JavaScript Functions That Define and Rewrite Themselves
By Darren JonesThe dynamic nature of JavaScript means that a function is able to not only call itself, but define itself, and even redefine itself. This is done by assigning an anonymous function to a variable that has the same name as the function.