Re: JS - Recursion and Closures

Jonathan Logue
Mon, 26 May 2008 19:48:45 -0000

Thanks so much! I kept reading about how the inner function had access
to the members of the outer function but could not find an example of
calling the actual function. You are a life saver.

I''ll buy you a beer if I am ever in Chicago!

-Jonathan

On May 26, 12:41 pm, "Frederick Polgardy"
<f...-SMQUYeM9IBBWk0Htik3J/w@public.gmane.org>
wrote:
> MyNS.Package.prototype.myRecursiveFunction >
function(SomeComplexDataStructure) {
> *    var outer = arguments.callee;*
>     SomeComplexDataStructure.DataPart.each( function(DataPart) {
> *      outer();*
>     } );
>   }
>
> -Fred
>
> On Mon, May 26, 2008 at 2:05 PM, Jonathan Logue
<jonathanlo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> wrote:
>
>
>
>
>
>
>
> > I am trying to figure out if it is possible to recursively call the
> > current outer function from within a closure while using the prototype
> > iterator. So...
>
> > var MyNS = {};
>
> > MyNS.Package = function() {}
>
> > MyNS.Package.prototype.myRecursiveFunction > >
function(SomeComplexDataStructure) {
>
> >  SomeComplexDataStructure.DataPart.each( function(DataPart) {  ??how
> > do I call myRecursiveFunction??  } );
>
> > }
>
> > Thanks!
>
> --
> Science answers questions; philosophy questions answers.- Hide quoted text
-
>
> - Show quoted text -