From 4a8ebc31f7a31e9771a51e5c92d2452551de9894 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Sun, 21 Nov 2021 00:44:37 +0100 Subject: [PATCH] fix listiterator.map returning undefined as the last element --- src/utils/ListIterator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/ListIterator.js b/src/utils/ListIterator.js index b38f743e..a38375cf 100644 --- a/src/utils/ListIterator.js +++ b/src/utils/ListIterator.js @@ -416,7 +416,7 @@ export class ListIterator { return this }, next: () => { - if (this.reachedEnd) { + if (this.reachedEnd || this.index === this.type._length) { return { done: true } } const [value] = this.slice(tr, 1)