interesting! When would length be undefined on an JQ object?
When I first saw the question, I thought of tail recursion, does JS deal well (optimize) tail recursion? On 10/6/06, Blair Mitchelmore <[EMAIL PROTECTED]> wrote: > I propose hcae: > > jQuery.fn.hcae = function( fn, args ) { > return jQuery.hcae( this, fn, args ); > }; > > jQuery.hcae = function( obj, fn, args ) { > if ( obj.length == undefined ) > for ( var i in obj ) > fn.apply( obj[i], args || [i, obj[i]] ); > else > for ( var i = obj.length - 1; i >= 0; --i ) > fn.apply( obj[i], args || [i, obj[i]] ); > return obj; > }; > > -blair ;) > > kenton.simpson wrote: > > Is there a way to make .each walk backwards threw the element collection? > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > -- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/