Why is this expression always false?
<p>I'm creating a Q&amp;A site that allows users to vote on answers.  I've set project.problem.upVoted to a list of answers which the user has already upvoted.  If the answer is already voted on, the callback for the upvote arrow's click event should delete the current vote, and if it's not already voted on, it should vote for it.</p>

<p>Here's the callback function for my uparrow image:</p>

<pre><code>project.problem.upVoteCallback = function(event)
{
    var answerID = $(this).parents("div.answer").find("input.answerID").attr("value");
    var isUpVoted = $.inArray(answerID, project.problem.upVoted) &gt; -1;

    //some debug statements
    alert("id: " + answerID + " | upvoted: " + project.problem.upVoted);
    alert("isupvoted: " + isUpVoted);

    if(isUpVoted)
    {
        //delete vote
    }
    else
    {
        //cast upvote
    }
}
</code></pre>

<p>The problem is that isUpVoted is always false.  For example, on my test page, when I try deleting a vote I get this output:</p>

<pre><code>id: 91 | upvoted: 91,92,93 
isupvoted : false
</code></pre>

<p>Yet if I copy the predicate to chrome's js console while substituting answerID with 91 it evaluates to true:</p>

<pre><code>$.inArray(91, project.problem.upVoted) &gt; -1; 
true
</code></pre>
