title: Difference Between indexOf and findIndex function of array
body: <p>I am confused between the difference between the two function indexOf and find Index in an  array.</p>
  
  <p>The documentation says</p>
  
  <blockquote>
    <p>findIndex - Returns the index of the first element in the array where
    predicate is true, and -1 otherwise.</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>indexOf - Returns the index of the first occurrence of a value in an
    array.</p>
  </blockquote>