JSFiddle - React, Tailwind, and code Playground
by seyenaz
JavaScript
var fruitarray = [];
fruitarray[0] = ['strawberry', 'orange'];
fruitarray[1] = ['lime', 'peach', 'banana'];
fruitarray[2] = ['tangerine', 'apricot'];
var newArray = fruitarray.concat.apply([], fruitarray); // in this case newArray is 'angerine'
var otherArray = fruitarray.concat.apply('undefined', fruitarray); // in this case otherArray is 'banana'
console.log("new array is: " + newArray);
console.log("other array is: " + otherArray);