title: Check if an element is present in a Bash array
body: <p>I was wondering if there is an efficient way to check if an element is present within an array  in Bash? I am looking for something similar to what I can do in Python, like:</p>
  
  <pre><code>arr = ['a','b','c','d']
  
  if 'd' in arr:
      do your thing
  else:
      do something
  </code></pre>
  
  <p>I've seen solutions using associative array for bash for Bash 4+, but I am wondering if there is another solution out there.</p>
  
  <p>Please understand that I know the trivial solution is to iterate in the array, but I don't want that.</p>