MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / flatten

Function flatten

Three.js/js/leap.js:5986–5995  ·  view source on GitHub ↗
(input, shallow, output)

Source from the content-addressed store, hash-verified

5984
5985 // Internal implementation of a recursive `flatten` function.
5986 var flatten = function(input, shallow, output) {
5987 each(input, function(value) {
5988 if (_.isArray(value)) {
5989 shallow ? push.apply(output, value) : flatten(value, shallow, output);
5990 } else {
5991 output.push(value);
5992 }
5993 });
5994 return output;
5995 };
5996
5997 // Return a completely flattened version of an array.
5998 _.flatten = function(array, shallow) {

Callers 1

leap.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected