I'm learning about Iterables from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators, and it clearly states that Array is Iterable. Inspecting it in chrome console, we can see it has Symbol.iterator
, and we can run for..of
on it.
But Arrays don't seem to follow the Iterator pattern of having a next()
method, which I kind of get, because you can't reset an iterator and that would be severely limiting on an array.
But I'm having trouble identifying from the docs what Iterables have the full implementation (next()) and which don't, or I'm missing a basic concept here.
What am I missing?