Issues with javascript splice
<p>I have a small piece of code in which i'm trying to splice an item from an array. In below code it should remove item which has "Javascript" and the resulting array should contain only "Java". What am i doing wrong here ?</p>

<pre><code>var autoCompleteArray = new Array();

var item = new Array();
item.push("1");
item.push("Java");
autoCompleteArray.push(item);

var item2 = new Array();
item2.push("2");
item2.push("Javascript");
autoCompleteArray.push(item2);


var val = "Javascript";

for(var i=0;i&lt;autoCompleteArray.length;i++){

  if(autoCompleteArray[i][1] == val) {

    autoCompleteArray.splice(autoCompleteArray[i],1);

  }
}

console.log(autoCompleteArray);  //Should show Java in the array since Javascript item has been removed.
</code></pre>
