title: Julia - check elementwise if elements of vector x are in the vector y
body: <p>I want to check elementwise (or broadcast) if the elements of vector x are in the vector y in Julia like what the function <code>checkin</code> does:</p>
  
  <pre><code>x = ["one", "two", "three", "four"]
  y = ["two", "three", "five", "four"]
  
  function checkin(x,y)
      for i = 1:length(y)
          if y[i] ∈ x
              println(true)
          else 
              println(false)
          end
      end
  end
  checkin(x,y)
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>true
  true
  false
  true
  </code></pre>
  
  <p>If I type </p>
  
  <pre><code>x .∈ y
  </code></pre>
  
  <p>or</p>
  
  <pre><code>x .in y
  </code></pre>
  
  <p>I get an error </p>
  
  <p>As often, I'm sure that there exist a much easier way to do it as writting a 9 line function, but I couldn't find it</p>