title: Get the array index of duplicates
body: <p>In a JavaScript array how can I get the index of duplicate strings?</p>
  
  <p>Example: </p>
  
  <pre><code>MyArray = ["abc","def","abc"]; //----&gt; return 0,2("abc");
  </code></pre>
  
  <p>Another example: </p>
  
  <pre><code>My Array = ["abc","def","abc","xyz","def","abc"] 
  //----&gt; return 0,2,5("abc") and 1,4("def");
  </code></pre>
  
  <p>I have no idea how to do this.
  Thanks in advance for your help!</p>