Skip to content

Commit

Permalink
edit array-from.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stonechoe committed Feb 23, 2024
1 parent 805f352 commit afb097d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core-js/internals/array-from.js
Expand Up @@ -26,9 +26,9 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
var length, result, step, iterator, next, value;
// if the target is not iterable or it's an array with the default iterator - use a simple case
if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
result = IS_CONSTRUCTOR ? new this() : [];
iterator = getIterator(O, iteratorMethod);
next = iterator.next;
result = IS_CONSTRUCTOR ? new this() : [];
for (;!(step = call(next, iterator)).done; index++) {
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
createProperty(result, index, value);
Expand Down

0 comments on commit afb097d

Please sign in to comment.