title: How do you access the groups of match/matchAll like an array?
body: <p>Here's what I would like to be able to do:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function convertVersionToNumber(line) {
    const groups = line.matchAll(/^# ([0-9]).([0-9][0-9]).([0-9][0-9])\s*/g);
  
    return parseInt(groups[1] + groups[2] + groups[3]);
  }
  
  convertVersionToNumber("# 1.03.00")</code></pre>
  </div>
  </div>
  </p>
  <p>This doesn't work because <code>groups</code> is an <code>IterableIterator&lt;RegExpMatchArray&gt;</code>, not an array. <code>Array.from</code> doesn't seem to turn it into an array of groups either. Is there an easy way (ideally something that can fit on a single line) that can convert <code>groups</code> into an array?</p>
  <p>The API of that <code>IterableIterator&lt;RegExpMatchArray&gt;</code> is a little inconvenient, and I don't know how to skip the first element in a <code>for...of</code>. I mean, I do know how to use both of these, it just seems like it's going to add 4+ lines so I'd like to know if there is a more concise way.</p>
  <p>I am using typescript, so if it has any syntactic sugar to do this, I'd be happy to use that.</p>