{"ast":null,"code":"'use strict'; // https://tc39.github.io/proposal-setmap-offrom/\n\nvar $export = require('./_export');\n\nvar aFunction = require('./_a-function');\n\nvar ctx = require('./_ctx');\n\nvar forOf = require('./_for-of');\n\nmodule.exports = function (COLLECTION) {\n  $export($export.S, COLLECTION, {\n    from: function from(source\n    /* , mapFn, thisArg */\n    ) {\n      var mapFn = arguments[1];\n      var mapping, A, n, cb;\n      aFunction(this);\n      mapping = mapFn !== undefined;\n      if (mapping) aFunction(mapFn);\n      if (source == undefined) return new this();\n      A = [];\n\n      if (mapping) {\n        n = 0;\n        cb = ctx(mapFn, arguments[2], 2);\n        forOf(source, false, function (nextItem) {\n          A.push(cb(nextItem, n++));\n        });\n      } else {\n        forOf(source, false, A.push, A);\n      }\n\n      return new this(A);\n    }\n  });\n};","map":null,"metadata":{},"sourceType":"script"}