← Back to challenges

Concatenate Variable Number of Input Arrays

JavaScriptHardlanguage_fundamentalsarrays

Instructions

Create a function that concatenates n input arrays, where n is variable.

Examples

concat([1, 2, 3], [4, 5], [6, 7]) ➞ [1, 2, 3, 4, 5, 6, 7]

concat([1], [2], [3], [4], [5], [6], [7]) ➞ [1, 2, 3, 4, 5, 6, 7]

concat([1, 2], [3, 4]) ➞ [1, 2, 3, 4]

concat([4, 4, 4, 4, 4]) ➞ [4, 4, 4, 4, 4]

Notes

Arrays should be concatenated in order of the arguments.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: All About Anonymous Functions: Adding Suffixes