Here you can find the source of concatAll()
Array.prototype.concatAll = function() { var results = []; this.forEach(function(subArray) { subArray.forEach((i) => {/*from ww w . j a va 2s . c om*/ results.push(i); }); }); return results; }; // JSON.stringify([ [1,2,3], [4,5,6], [7,8,9] ].concatAll()) === "[1,2,3,4,5,6,7,8,9]" // [1,2,3].concatAll(); // throws an error because this is a one-dimensional array
Array.prototype.concatAll = function() { let result = []; this.forEach(items => result = result.concat(items) ); return result;
Array.prototype.concatAll = function() { let results = []; for (let i = 0; i < this.length; i++) { results.push.apply(results, this[i]); return results; };
Array.prototype.concatAll = function() { return this.reduce((results, current) => { if(Array.isArray(current)) { return results.concat(current).concatAll(); } else { return (results.push(current), results); }, []); }; ...
Array.prototype.concatAll = function() { var results = []; this.forEach(function(subArray) { if (Array.isArray(subArray)) { subArray.forEach(function(item) { results.push(item); }); }); ...
Array.prototype.concatAll = function () { let results = []; this.forEach(function (subArray) { results.push.apply(results, subArray); }); return results; };
let data = [ [ {name: "IBM", price:12}, {name: "Apple", price:120} ], [ {name: "Google", price:100}, {name: "MorganStanley", price:30} ] ...
Array.prototype.concatAll = function() { var results = []; this.forEach(function(subArray) { subArray.forEach(function(item){ results.push(item) }) }); return results; }; ...
Array.prototype.concatAll = function() { var results = []; this.forEach(function(subArray) { subArray.forEach(function(element){ results.push(element); }); }); return results; }; ...
let exchanges = [ [ { symbol: 'XFX', price: 240.22, volume: 23432 }, { symbol: 'TNZ', price: 332.19, volume: 234 }, ], [ { symbol: 'JXJ', price: 120.22, volume: 5323 }, { symbol: 'NYN', price: 88.47, volume: 98275 }, ], ...