title: How to get the nth occurrence in a string?
body: <p>I would like to get the starting position of the <code>2nd</code> occurrence of <code>ABC</code> with something like this:</p>
  
  <pre><code>var string = "XYZ 123 ABC 456 ABC 789 ABC";
  getPosition(string, 'ABC', 2) // --&gt; 16
  </code></pre>
  
  <p>How would you do it?</p>