Re: JS - Recursion and Closures

Frederick Polgardy
Mon, 26 May 2008 19:41:22 -0000

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
<jonathanlogue-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.