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:
大數(shù)據(jù)培訓(xùn),云培訓(xùn),數(shù)據(jù)挖掘培訓(xùn),云計算培訓(xùn),高端軟件開發(fā)培訓(xùn),項目經(jīng)理培訓(xùn)

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