From c15bdeb1376621382b69b8d3b6a838b14cc5ccca Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Sun, 12 Jul 2020 15:18:34 +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 cbd7179..c8586b4 100644 --- a/ckciw2lr900d0xas144h5fpwm.md +++ b/ckciw2lr900d0xas144h5fpwm.md @@ -19,7 +19,7 @@ This is how the iterable/iterator stuff works. In our case, Iterable is `someArray` - which has a special property `Symbol.iterator` whose value is a method. Calling this method returns a iterable (`iter`), which has `.next()` method. Calling this method returns all the values one-by-one. -## ArrayIterator +## Array Iterator Array has in-built support for iterable/iterator protocol, through prototype. Array.prototype has a method with key `Symbol.iterator`, which creates a ArrayIterator.