This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21126 - Array.concatArraysToArray(Array,Array...) - merge multiple arrays
Summary: Array.concatArraysToArray(Array,Array...) - merge multiple arrays
Status: RESOLVED INVALID
Alias: None
Product: WHATWG
Classification: Unclassified
Component: JavaScript (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 enhancement
Target Milestone: Unsorted
Assignee: Mathias Bynens
QA Contact: sideshowbarker+javascript
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-26 12:20 UTC by Jim Michaels
Modified: 2014-06-21 12:51 UTC (History)
1 user (show)

See Also:


Attachments

Description Jim Michaels 2013-02-26 12:20:58 UTC
there is currently nothing in javascript to merge 2 arrays into 1 array (in sequence).
so I propose 
Array.concatArraysToArray([Array...])

I don't know how javascript works internally with arrays, so I don't know how the specification should look.  but the returned array should contain each argument's elements, in sequence.

Array.concat([item...]) won't do what I am looking for, it ruins arrays. maybe this should be a bug report?

one would hope you could do
var arr = Array();
arr = arr.concat(Array(1,2),Array(4,"jack"),Array(5,9,11));
and end up with arr containing Array(1,2,4,"jack",5,9,11), but that's not what you get. but this is what I am proposing.
I tried all the functions that looked promising. none work.
Comment 1 Mathias Bynens 2014-06-21 12:51:17 UTC
This is outside the scope of the JavaScript / Web ECMAScript spec. See <http://javascript.spec.whatwg.org/#goals>.

To propose new features to the ECMAScript language, please file a bug on https://bugs.ecmascript.org/.