title: Run IndexOf more than one time JS
body: <p>How to search multiple same values and look if it meets the conditions without regex? Suppose that I have this string <code>***6**5****8*9***2</code>
  What I need to do is to check if the string has at least three times <code>***</code> altogether and then if the number before and after the <code>***</code> sums 11. In the example given, these conditions are met because: First, the string has three <code>***</code> altogether, and then 9 + 2 is 11.</p>
  <p>I have solved this problem using regex, match, and replace, but how I can do it without applying to those solutions.</p>
  <p>I have tried to do this without regex but it did not work because indexOf is only giving me one result:</p>
  <pre><code>string = &quot;***6**5****8*9***2&quot;;
  
    for (var i = 0; i &lt; string.length; i++) {
       let where = (string.indexOf(&quot;***&quot;));
       let a = parseInt(string.charAt(where - 1)); 
       let b = parseInt(string.charAt(where + 3));
      if (a + b == 11){
          isTrue = true;             
      }
     }
  </code></pre>