errrm... thanks Karl... but I get:
":last" is not a function obviously, I'm not piecing this together quite right: var arr = new Array(2) arr[0] = $('ul#list1').size() arr[1] = $('ul#list2').size() arr[2] = $('ul#list3').size() var largest = arr.sort(function(a,b){return a - b}).filter(':last') Karl Swedberg-2 wrote: > > Hi Rolfsf, > > Instead of .slice(-1), you can use .filter(':last') > > > --Karl > _________________ > Karl Swedberg > www.englishrules.com > www.learningjquery.com > > > > On Oct 24, 2007, at 3:53 PM, rolfsf wrote: > >> >> >> Thanks Josh & Andy! >> >> I may not be able to upgrade to jQuery 1.2 right away - what's my >> alternative for slice()? >> >> r. >> >> >> Andy Matthews-4 wrote: >>> >>> >>> This will give you the highest val without having to loop over the >>> array: >>> >>> var arr = new Array(6) >>> arr[0] = "10" >>> arr[1] = "5" >>> arr[2] = "40" >>> arr[3] = "25" >>> arr[4] = "1000" >>> arr[5] = "1" >>> arr[6] = "1001" >>> >>> var largest = arr.sort(function(a,b){return a - b}).slice(-1) >>> >>> >> >> -- >> View this message in context: http://www.nabble.com/help--- >> compare-3-lists%2C-get-the-largest-number-of-items...- >> tf4685230s27240.html#a13393735 >> Sent from the jQuery General Discussion mailing list archive at >> Nabble.com. >> > > > -- View this message in context: http://www.nabble.com/help---compare-3-lists%2C-get-the-largest-number-of-items...-tf4685230s27240.html#a13396402 Sent from the jQuery General Discussion mailing list archive at Nabble.com.