jQuery.inArray not behaving as expected
<p>I'm trying to loop through a list of numbers and check if that number is part of another list of numbers using jQuery.each and jQuery.inArray. jQuery.inArray does not seem to be behaving as expected.</p>

<p>Here is my code:</p>

<pre><code>var some_numbers = [1, 2];
var more_numbers = [0, 1, 2];

$.each(more_numbers, function(index, value) {
  if($.inArray(value, some_numbers)) {
    console.log(value);
  }
});

console.log('Some Numbers:');
console.log(some_numbers);
</code></pre>

<p>Here is the resulting console output:</p>

<pre><code>0
2
Some Numbers:
[1, 2]
</code></pre>

<p>Will someone please help? This is maddening.</p>

<p><strong>Edit:</strong> Problem solved! Changed my condition to this:</p>

<pre><code>if($.inArray(value, some_numbers) !== -1)
</code></pre>

<p>Thanks everyone!</p>
