Introduction

Iterator is one of the most common design modes in daily development. Let's explore the iterator continent in the javacript world, here we go!

Gist Iterator Mode

It's the basic iterator mode concept:
大数据培训,云培训,数据挖掘培训,云计算培训,高端软件开发培训,项目经理培训

Grammar rules

Attention

Assume that "iterable" is an adjective, and "iterableFn" is a iterable.
It's a little confusing when lots of "iterable" appear at the same time.

Relation between iterable and iterator

Iterator can be created by iterableFn(an iterable), iterableFn belongs to iterable sources.

Iterables

Iterable sources

  • Array

  • String

  • Map

  • Set

  • Dom Elements

  • Arguments

Get iterableFn(used to generate iterator)

IterableFn can be derived from iterable source by its property: Symbol.iterator, for examp