searching inside an array for a value
<p>Morning Guys</p>

<p>im currently playing with javascript and am creating a simple black jack game, i want to keep track of cards which have already been pulled from the pack. heres my function</p>

<pre><code>function usedCards(value,suit)
{
var exists = false;

for(i = 0; i&lt; usedCardNo.length;i++)
  {
    if (value === usedCardNo[i] &amp;&amp; suit === usedCardSuit[i])
         {
            exists = true;
            console.log(i);         
         } 
  }
    console.log("exists = " + exists);

if (exists===false)
         {
             usedCardNo.push(value);
             usedCardSuit.push(suit);
             console.log(value + " and " + suit +" added to array");        
          } 
}
</code></pre>

<p>i pass the function 2 id numbers one realting to card number ie ace, 7, 9 aswell as suit.</p>

<p>i then check if it already exists in the array, if not add it. but its not currently working?? it just doesnt recognise a duplicate value.</p>
