title: Finding the index to a non-specified character
body: <p>Let's say for example I have a string</p>
  
  <pre><code>thisIsThisTuesday Day
  </code></pre>
  
  <p>I want to find the index of all the capital letters, test if there is a space before it, and if not insert one.  I would need the index of each one. 
  At least from what I can see <code>indexOf(String)</code> will only produce the index of the first occurance of the character <code>T/t</code> </p>
  
  <p>This : </p>
  
  <pre><code>for(i=0;i&lt;str.length;i++){
    let char=str[i];
  
    if(isNaN(char*1)&amp;&amp;char==char.toUpperCase()){
      y=str.indexOf(char);
      console.log(char,y)
    }
  }
  </code></pre>
  
  <p>would produce the capital letters, and their indexes but will only display the first occurrence of the character in question. I feel pretty confident that the part I am missing is a for() loop in order to move the index iteration..but it escapes me. </p>
  
  <p>Thank you in advance!</p>