title: What is the meaning of *[Symbol.iterator] in this context
body: <p>I found some code online. I've squashed the original code down into this little excerpt, that when ran, will print 1-20 to the console.</p>
  
  <pre><code>var NumbersFromOne = {
    *[Symbol.iterator] () {
      for (let i = 1;; ++i) yield i;
    }
  };
  
  var take = function* (numberToTake, iterable) {
    let remaining = numberToTake;
  
    for (let value of NumbersFromOne) {
      if (remaining-- &lt;= 0) break;
      yield value;
    }
  }
  
  
  var printToTwenty = take(20, NumbersFromOne)
  
  console.log(...printToTwenty);
  </code></pre>
  
  <p>Now, I understand that take() is a GeneratorFunction.<br>
  When take() is called, it is given an iterator.<br>
  The code "...printToTwenty" uses the spread operator to iterate through that function.</p>
  
  <p>I understand that NumbersFromOne is an object.
  I've come here looking for an explanation of what this part means:</p>
  
  <pre><code>*[Symbol.iterator] () {}
  </code></pre>
  
  <p>Declaring generator functions is done like this: function* () {} <br>
  So I'm assuming this isn't declaring a generator function.</p>
  
  <p>* also doesn't represent the function name <br>
  * also can't be replaced with another operator (/, -, +)</p>
  
  <p>What is the deal with that syntax, and why is the * before [Symbol.iterator] <br>
  If placed after, it will not run. <br>
  I had considered that *[Symbol.iterator] () is a way to overwrite the existing iterator property, but then wouldn't it say this[Symbol.iterator].</p>
  
  <p>Thanks!</p>