It's interesting to note that in JavaScript version 1.7, array
comprehensions allows you do achieve this kind of 'filling' of your


function range(begin, end) {
  for (let i = begin; i < end; ++i) {
    yield i;

var n = [0 for each (i in range(0,20))]
// [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

info from:

On Jun 8, 2:44 am, Jay Tee <[EMAIL PROTECTED]> wrote:
> On Jun 3, 10:06 am, Yanick <[EMAIL PROTECTED]> wrote:
> > Hope this helps. (And if the core folks think this is core worthy, I
> > think it could make a pretty addon.)
> > yanick
> You've helped very much!  This particular function has helped me with
> populating grids more than anything else.  It's so much easier to fill
> an array like this than loop or use a literal; especially for
> particularly long arrays :)
> Jon
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to