Why does Array.from also take a mapFn?
allen at wirfs-brock.com
Tue Jun 25 12:23:17 PDT 2013
On Jun 25, 2013, at 12:12 PM, Rick Waldron wrote:
> On Tue, Jun 25, 2013 at 3:09 PM, Hudson, Rick <rick.hudson at intel.com> wrote:
> I'm trying to understand this particular line.
> var squaredSmalls_try3 = Int16Array.from(smalls, map(v=> v*v)); //the plan is for this to work.
> To me I would expect a complaint that map is undefined. Should map be implied?
> It looks like a leftover from copying this line:
> > Int16Array.from(smalls.map(v=> v*v));
> assume that he means:
> Int16Array.from(smalls, v=> v*v);
yup, that's what I meant.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss