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:
will Array#concat produce results of the same subclass too ?
what are we suppose to expect from the classic
[].slice.call(arguments) operation, an instanceof Arguments ?
Thanks for any clarification.
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>
In latest ES6 draft I can read this change:
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:
[].slice.call(arguments)
operation, aninstanceof Arguments
?Thanks for any clarification.