title: javascript findIndex callback arguments
body: <p>I'm new to javascript.</p>
  
  <p>I'm trying to find the index of a specific element in an array. I read about that I can use findIndex to loop through an array. But it seems that findIndex only accept three arguments: element, index and array. What if I want change the object that is used to be compared.</p>
  
  <p>For example, I want for find the index of string <code>'b'</code> in array <code>['a','b','c']</code>, </p>
  
  <pre><code>var position = ['a','b','c'].findIndex(function(element, index, array){return element==='b'})
  </code></pre>
  
  <p>but how do I pass <code>'b'</code> as parameters that I can change to callback function</p>
  
  <p>Thanks</p>