UNPKG

terriajs

Version:

Geospatial data visualization platform.

12 lines (11 loc) 410 B
/** * Flattens an array of arrays, into an array, eg. [[0, 1], [2, 3], [4, 5]] => [0, 1, 2, 3, 4, 5]. * Based on the example at * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce */ export default function flatten(arrayOfArrays) { return arrayOfArrays.reduce(function (a, b) { return a.concat(b); }, []); } //# sourceMappingURL=flatten.js.map