Originally Posted by rnd me
aw man, you shoulda stopped while you're ahead; you got the ball rollin on this. i did cover the 2nd arg implications in my follow-up to Dormilich's note. or, i should say, i tried...
but, for the sake of accurate info for noobs reading this thread, i must point out that you are dead wrong about this particular point.
Strange because I tested it prior to adding that comment to the end of my post and only added the comment because in the browser I was testing in the value that parameter did make a difference.
The test I did was with my original array with the - sign removed and replacing max with min - and then with the 0 as the second parameter I got the 0 returned instead of the 2 only by changing the 0 to a number bigger than the minimum in the array could I get it to return the right answer. The first parameter to the bind substitutes for 'this' but the second parameter simply got added to the array.
Obviously the implementation of bind varies slightly between browsers. Had my test returned the same result that your's did then I would not have gone back and amended the post to add that sentence. The difference probably relates to the number of objects that the browser considers to be involved that need to have a value supplied for 'this'.
Helping others to solve their computer problem at http://www.felgall.com/