title: Filter out the odd one out from an array, then return the index position
body: <p>I have an array of the same word however one of the words in the array is spelt backwards. The function returns the index position of the "wrong" word.  The below code works perfectly fine but it is quite long.  </p>
  
  <p>I want to know if there is a way to shorten the code and still have it return the same value?</p>
  
  <pre><code>function oddOneOut(arr) {
  
    let word = ''
  
    if (arr[0] === arr[1]) {
      word = arr[0]
    }
    if (arr[1] === arr[2]) {
      word = arr[1]
    }
    if (arr[2] === arr[3]) {
      word = arr[2]
    }
    function wrong(element) {
      return element !== word
    }
    return arr.findIndex(wrong)
  }
  
  console.log(oddOneOut(["sword", "sword", "sword", "sword", "drows", "sword"]))
  
  //returns 4
  </code></pre>