title: How to get the element second index in an array in javascript?
body: <p>I have an array as follows:</p>
  
  <pre><code>var arr = [10, 12, 34, 23, 12, 89, 34, 12];
  </code></pre>
  
  <p>In this I've <code>12</code> three times. I want to find the second index of <code>12</code> in JavaScript. I tried with <code>lastIndexOf()</code> but it did not help me. Is there any way to find this?</p>