Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (arguments.length > 2) {
T = arguments[2];
}
}
var arrayLike = ES.ToObject(parseIterableLike(items));
var len = ES.ToLength(arrayLike.length);
var A = ES.IsCallable(C) ? ES.ToObject(new C(len)) : new Array(len);
var k = 0;
var kValue, mappedValue;
while (k < len) {
kValue = arrayLike[k];
if (mapFn) {
mappedValue = typeof T === 'undefined' ? mapFn(kValue, k) : ES.Call(mapFn, T, [kValue, k]);
} else {
mappedValue = kValue;
}
defineProperty(A, k, {
'configurable': true,
'enumerable': true,
'value': mappedValue,
'writable': true
});
k += 1;
}
A.length = len;
return A;
};
if (!ES.IsCallable(mapFn)) {
throw new TypeError('When provided, the second argument to `Array.from` must be a function');
}
if (arguments.length > 2) {
T = arguments[2];
}
}
var len = ES.ToLength(items.length);
var A = ES.IsCallable(C) ? ES.ToObject(new C(len)) : new Array(len);
var k = 0;
var kValue, mappedValue;
while (k < len) {
kValue = items[k];
if (mapFn) {
mappedValue = typeof T === 'undefined' ? mapFn(kValue, k) : ES.Call(mapFn, T, [kValue, k]);
} else {
mappedValue = kValue;
}
defineProperty(A, k, {
'configurable': true,
'enumerable': true,
'value': mappedValue,
'writable': true
});
k += 1;
}
A.length = len;
return A;
};