title: Avoid double input of items in an array
body: <p>I have the following code which works</p>
  
  <pre><code>def add_item!(item, list)
    list &lt;&lt; item
    list # this is what we return from the method
  end
  </code></pre>
  
  <p>And if I had items to it it works.</p>
  
  <pre><code>add_item!(2, "henk")
  add_item!(3, "george")
  </code></pre>
  
  <p>I however want to include a check whether the item is already in the list. I thought about doing this using the list.include? function. If I try this i get </p>
  
  <pre><code>def add_item! (item, list)
  
    if list.include?(item)
      list &lt;&lt; item
      list
    else
      puts "This is a double item"
    end
  end
  
  add_item!(2, "list")
  add_item!(2, "list")
  </code></pre>
  
  <p>This however gets me the following error:</p>
  
  <pre><code>TypeError: can't convert Fixnum into String
  </code></pre>
  
  <p>I dont understand why this is happening and can avoid this. Any thoughts?</p>