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');
$R(1,5).each(function(n){
console.log(arr[n]);
});
//-> should output the words quick through over, one to a line, in your console.
I'm sure there's another way, but that's what I would do.
Walter
> --
> 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/-/hyCKraRuIykJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.