Jussi Kalliokoski (2014-10-30T13:35:52.000Z)
On Thu, Oct 30, 2014 at 3:14 PM, Adrian Perez de Castro <aperez at igalia.com>
wrote:

> On Thu, 30 Oct 2014 09:29:36 +0100, Florian Bösch <pyalot at gmail.com>
> wrote:
>
> > The usecases:
> >
> > [...]
> >
> > *3) Initializing an existing array with a repeated numerical value*
> >
> > For audio processing, physics and a range of other tasks it's important
> to
> > initialize an array with the same data.
> >
> > for(var i=0; i<size; i++){ someArray[i] = 0; }
>
> For this use case there is %TypedArray%.prototype.fill(), see:
>

Oh, nice! Had completely missed fill() before. Hope to see this land soon.
:)


>
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-%typedarray%.prototype.fill
>
> JavaScript engines are expected to implement it at some point. For example
> I am implementing this in V8, along with other new typed array methods. The
> engines should be able to generate quite good code for uses of this
> function
> and/or provide optimized versions relying on knowledge of the underlying
> element type of the typed array they are applied to.
>
> Cheers,
>
> --
>  ☺ Adrián
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141030/1e71bb52/attachment.html>
d at domenic.me (2014-11-18T23:18:22.920Z)
Oh, nice! Had completely missed fill() before. Hope to see this land soon.
:)