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

E.g.

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: http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7

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 prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to