Grouping i.e. () is not working properly : <pre><code>"&amp; Help is available in the Library, ".match(/(i)/)
</code></pre>

<p>This should be returning all the matches for "i". 
Instead it's returning only 2.</p>

<p><a href="https://i.stack.imgur.com/gm9SA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gm9SA.png" alt="enter image description here"></a></p>

<p>Two questions </p>

<ol>
<li><p>It should be returning all the matches as that is suggested by mdn </p></li>
<li><p>What does index=7 mean in the array(in the picture)</p></li>
</ol>

<p>For reference, Here is the definition that found on mdn</p>

<blockquote>
  <p>(x)<br>
  Matches x and remembers the match. These are called capturing
  groups.</p>
  
  <p>For example, /(foo)/ matches and remembers "foo" in "foo bar". </p>
  
  <p>The capturing groups are numbered according to the order of left
  parentheses of capturing groups, starting from 1. The matched
  substring can be recalled from the resulting array's elements <a href="https://i.stack.imgur.com/gm9SA.png" rel="nofollow noreferrer">1</a>,
  ..., [n] or from the predefined RegExp object's properties $1, ...,
  $9.</p>
  
  <p>Capturing groups have a performance penalty. If you don't need the
  matched substring to be recalled, prefer non-capturing parentheses
  (see below).</p>
</blockquote>
