 type of function in ECMAScript 6 that can return multiple values over time.
These special functions are indicated by placing an <code class="highlighter-rouge">*</code> after the <code class="highlighter-rouge">function</code> keyword.</p>

<p>Here is an example of a generator function:</p>

<div class="highlighter-rouge"><pre class="highlight"><code><span class="cm">/*eslint-env es6*/</span><br/><br/><span class="kd">function</span><span class="o">*</span> <span class="nx">generator</span><span class="p">