MCPcopy
hub / github.com/phaserjs/phaser / Flatten

Function Flatten

src/utils/array/Flatten.js:21–38  ·  view source on GitHub ↗
(array, output)

Source from the content-addressed store, hash-verified

19 * @return {array} The flattened output array.
20 */
21var Flatten = function (array, output)
22{
23 if (output === undefined) { output = []; }
24
25 for (var i = 0; i < array.length; i++)
26 {
27 if (Array.isArray(array[i]))
28 {
29 Flatten(array[i], output);
30 }
31 else
32 {
33 output.push(array[i]);
34 }
35 }
36
37 return output;
38};
39
40module.exports = Flatten;

Callers 2

TweenManager.jsFile · 0.85
Flatten.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…