jquery.inArray() function not working
<p>I am having a array as follows</p>

<pre><code>       var nameIDHashMap = [];
       nameIDHashMap.push({
            key: name,
            value: xmlLength
       });
     startToEnd.push({
          key: $(this).attr("startFrom"),
          value: $(this).attr("endTo")
    });
</code></pre>

<p>I m trying to use the inArray() function like shown below</p>

<pre><code>            var variablestart = startToEnd[0].key;
            alert("The variable Start is :"+variablestart);
            var toEnd;
            if(jQuery.inArray(variablestart,nameIDHashMap) &gt; -1) {
                alert('found');
            }
            if ($.inArray(variablestart, nameIDHashMap) != -1) 
            {
                alert("Found");
            //  toEnd = startToEnd[connectWindow].value
            }
            else
                alert("Fail");
</code></pre>

<p>I dont know why always the else loop is called. None of the if loop is getting called. Both of the array has that same key present. Please let me know where I am doing wrong.Thanks!</p>
