December 2013
Intermediate to advanced
384 pages
9h 54m
English
var fruits = ["banana", "apple", "orange"]; var veggies = ["broccoli", "carrots", "spinach"]; var grains = ["wheat", "oats"]; var food = grains.concat(fruits, veggies); //food = ["wheat","oats","broccoli","carrots", "spinach","banana","apple","orange"]
You can combine multiple arrays using the .concat(arr, arr, ...) method. This returns a new array object with the array elements combined inside.
Read now
Unlock full access