function getForm()
{
var arry =[ [0,1] ,[1,2],[2,3],[3,4]];
var a;
var x = 1 ;
console.log(x);
for (i = 0; i < arry.length; ++i)
{
if (arry[i][0] == x)
{
a = arry[i][1];
}
console.log(a);
}
}
I am totally new to JavaScript, I was running this programming in Firebug. I have got the output as undefined I was expecting the output x=1,a=2(I mean first console.log and second one). I was defined all the variables inside the function only.
undefined