[jquery-dev] Re: Array.prototype.indexOf not fully utilized in jQuery.inArray

2009-12-14 Thread Robert Katić
Already fixed. If Array.prototype.indexOf exists, then it is always used. On Dec 14, 10:38 am, helianthus project.heliant...@gmail.com wrote: This occurs when using jQuery.fn.index, which utilizes jQuery.inArray. Since the jQuery object does not have an indexOf method, it falls back to the for

[jquery-dev] Re: Array.prototype.indexOf not fully utilized in jQuery.inArray

2009-12-14 Thread caii
it's no about Array.prototype.indexOf. where ie it? On Dec 14, 5:38 pm, helianthus project.heliant...@gmail.com wrote: This occurs when using jQuery.fn.index, which utilizes jQuery.inArray. Since the jQuery object does not have an indexOf method, it falls back to the for loop approach, while

[jquery-dev] Re: Array.prototype.indexOf not fully utilized in jQuery.inArray

2009-12-14 Thread Markw65
Why is it done this way: inArray: function( elem, array ) { if ( array.indexOf ) { return array.indexOf( elem ); } for ( var i = 0, length = array.length; i length; i++ ) { if ( array[ i ] ===

Re: [jquery-dev] Re: Array.prototype.indexOf not fully utilized in jQuery.inArray

2009-12-14 Thread John Resig
The case is precisely it: We do it that way because we need to support array-like objects as well. (The docs are written in that particular manner because saying .inArray(ArrayLikeObject) would probably just confuse the issue.) If the difference is between doing an extra .call() (which is slower