Sha256: d9dc802fc522859be1bcd9ec9265c2e422d22599b539b534224d4cd4960f5c29

Contents?: true

Size: 745 Bytes

Versions: 82

Compression:

Stored size: 745 Bytes

Contents

'use strict';
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten
var $export = require('./_export');
var flattenIntoArray = require('./_flatten-into-array');
var toObject = require('./_to-object');
var toLength = require('./_to-length');
var toInteger = require('./_to-integer');
var arraySpeciesCreate = require('./_array-species-create');

$export($export.P, 'Array', {
  flatten: function flatten(/* depthArg = 1 */) {
    var depthArg = arguments[0];
    var O = toObject(this);
    var sourceLen = toLength(O.length);
    var A = arraySpeciesCreate(O, 0);
    flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
    return A;
  }
});

require('./_add-to-unscopables')('flatten');

Version data entries

82 entries across 38 versions & 8 rubygems

Version Path
immosquare-cleaner-0.1.40 node_modules/core-js/modules/es7.array.flatten.js
immosquare-cleaner-0.1.40 node_modules/core-js/library/modules/es7.array.flatten.js
optimacms-0.1.61 spec/dummy/node_modules/babel-runtime/node_modules/core-js/library/modules/es7.array.flatten.js
optimacms-0.1.61 spec/dummy/node_modules/babel-runtime/node_modules/core-js/modules/es7.array.flatten.js
ilog-0.4.1 node_modules/babel-runtime/node_modules/core-js/library/modules/es7.array.flatten.js
ilog-0.4.1 node_modules/babel-register/node_modules/core-js/modules/es7.array.flatten.js
ilog-0.4.1 node_modules/babel-register/node_modules/core-js/library/modules/es7.array.flatten.js
ilog-0.4.1 node_modules/babel-runtime/node_modules/core-js/modules/es7.array.flatten.js
ilog-0.4.0 node_modules/babel-runtime/node_modules/core-js/library/modules/es7.array.flatten.js
ilog-0.4.0 node_modules/babel-register/node_modules/core-js/modules/es7.array.flatten.js
ilog-0.4.0 node_modules/babel-register/node_modules/core-js/library/modules/es7.array.flatten.js
ilog-0.4.0 node_modules/babel-runtime/node_modules/core-js/modules/es7.array.flatten.js
ilog-0.3.3 node_modules/babel-runtime/node_modules/core-js/library/modules/es7.array.flatten.js
ilog-0.3.3 node_modules/babel-register/node_modules/core-js/modules/es7.array.flatten.js
ilog-0.3.3 node_modules/babel-register/node_modules/core-js/library/modules/es7.array.flatten.js
ilog-0.3.3 node_modules/babel-runtime/node_modules/core-js/modules/es7.array.flatten.js
condenser-0.0.5 lib/condenser/processors/node_modules/core-js/library/modules/es7.array.flatten.js
condenser-0.0.5 lib/condenser/processors/node_modules/core-js/modules/es7.array.flatten.js
optimacms-0.4.3 spec/dummy/node_modules/core-js/library/modules/es7.array.flatten.js
optimacms-0.4.3 spec/dummy/node_modules/core-js/modules/es7.array.flatten.js