[Proto-Scripty] Select range of array items

2012-01-12 Thread kstubs
I have an array of objects. I'd like to grab items from the array by specifying a range like 1-10, or 11-20, or 5-7, and so on.. Seems trivial. How is this done with Prototype? -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To

Re: [Proto-Scripty] Select range of array items

2012-01-12 Thread Walter Lee Davis
On Jan 12, 2012, at 1:04 PM, kstubs wrote: I have an array of objects. I'd like to grab items from the array by specifying a range like 1-10, or 11-20, or 5-7, and so on.. Seems trivial. How is this done with Prototype? var arr = $w('the quick brown fox jumped over the lazy dog');

Re: [Proto-Scripty] Select range of array items

2012-01-12 Thread kstubs
That should work. Was imagining a method off the array object directly. Thanks. Karl.. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit

Re: [Proto-Scripty] Select range of array items

2012-01-12 Thread Walter Lee Davis
Well, you can always use the generic Array.slice() method. $A($w('the quick brown fox jumped over the lazy dog').slice(1,5)).each(function(elm){console.log(elm);}); Walter On Jan 12, 2012, at 1:54 PM, kstubs wrote: That should work. Was imagining a method off the array object directly.

Re: [Proto-Scripty] Select range of array items

2012-01-12 Thread kstubs
Ahh yes, of course! Thanks Walter. Karl.. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/zOftjBzBA9EJ. To post to this group,

Re: [Proto-Scripty] Select range of array items

2012-01-12 Thread Walter Lee Davis
Just to point out, the $A( ) wrapper around the slice product was there because you can't guarantee an extended array in IE without it. Every other browser would be fine. Also, if you weren't using any Prototype magic on the output array, you could skip that as well. Walter On Jan 12, 2012,

[Proto-Scripty] Re: Select range of array items

2012-01-12 Thread T.J. Crowder
On Jan 12, 7:14 pm, Walter Lee Davis wa...@wdstudio.com wrote: Just to point out, the $A( ) wrapper around the slice product was there because you can't guarantee an extended array in IE without it. Every other browser would be fine. No, IE allows Prototype to automagically extend arrays just

[Proto-Scripty] Re: Select range of array items

2012-01-12 Thread Victor
automagically :) -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/je-nzPkGXDEJ. To post to this group, send email to