You want to combine arrays into one.
For example, you have
fruits = ['Broccoli', 'Carrots']
spices = ['Thyme', 'Cinnamon']
and you want to combine them into
ingredients = ['Broccoli', 'Carrots', 'Thyme', 'Cinnamon']
.concat
ingredients = fruits.concat spices
ingredients = [fruits..., spices...]
.concat
with indeterminate number of arraysIf the number of arrays can vary, e.g. you have array of arrays:
arrayOfArrays = [[1], [2,3], [4]]
[].concat.apply([], arrayOfArrays) # [1, 2, 3, 4]