title: Get index of Item in Loop to match against stored Indices
body: <p>I have a scenario where I want to perform an action if a string in a list of string matches the index in a list of ints (Generated based on String list ) </p>
  
  <p>The below is some pseudo code to try and articulate what I am trying to achieve. </p>
  
  <pre class="lang-dart prettyprint-override"><code>List&lt;int&gt; wordIndex = [1,3,5];
  List&lt;String&gt; wordList = ['this', 'is','a', 'test', 'a'];
  
  //Pseudo code
  wordList.forEach(word)) {
   if (wordIndex item matches index of word) {
      do something;
    } else {
      od something else;
   }
  }
  </code></pre>
  
  <p>it the <code>if (wordIndex item matches index of word)</code> where I am having a problem and would appreciate any ideas.</p>