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
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');
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
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.
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,
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,
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
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