I am a beginer to javascript.I have a doubt.my code is given bellow.when i run this the 1st alert box displaying "undefind".i can not understand why?thanks alot..
<html>
<head>
<script type="text/javascript">
var a = 123;
function foo()
{
alert(a);
var a = 890;
alert(a);
}
foo();
alert(a);
</script>
</head>
<body>
</body>
</html>