Array subclasses and concat() ?

Andrea Giammarchi andrea.giammarchi at gmail.com
Mon Sep 9 15:42:30 PDT 2013


In latest ES6 draft I can read this change:


   - Array.prototype.map, filter, slice, splice when used iwth array
   subclasses creates results arrays of the same subclass

which is good/cool/eventually/hoooray **but** something that has been
problematic since ever in subclassing Array in JS is Array#concat, together
with Array#slice and all others that returns an Array from a _array-like_
object.

I see that slice and splice are in but reading current draft I wonder these
two things:

  1. will Array#concat produce results of the same subclass too ?
  2. what are we suppose to expect from the classic
`[].slice.call(arguments)` operation, an `instanceof Arguments` ?

Thanks for any clarification.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130909/b249d148/attachment.html>


More information about the es-discuss mailing list