From 2389d729a1a712c09e7711ba85acecc415230527 Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Mon, 13 Jul 2020 19:27:36 +0530 Subject: [PATCH] update post: How does in-built Array iterator work? --- ckciw2lr900d0xas144h5fpwm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckciw2lr900d0xas144h5fpwm.md b/ckciw2lr900d0xas144h5fpwm.md index f5d3de1..0ee2a25 100644 --- a/ckciw2lr900d0xas144h5fpwm.md +++ b/ckciw2lr900d0xas144h5fpwm.md @@ -69,7 +69,7 @@ Now that we have the in-built array iterator, the most important thing is knowin 3. Else, (i.e. when `index >= arr.length` - reached end of array) a. Set `[[IteratedArrayLike]]` = `undefined`. - (⭐️ 2️⃣ Yes, once it reaches the end - it sets linked array to undefined. This is to ensure the once the iterator has finished, it will never return any more value. This undefined array is handled in step 1. + (⭐️ 2️⃣ Yes, once it reaches the end - it sets linked array to undefined. This is to ensure that once the iterator has finished, it will never return any more value. This undefined array is handled in step 1. If this was not done and if array length was increased before next call, then it would again return new values after saying `done:true` earlier.) b. Return `{value: undefined, done: false}`