var a = 1; b = 2; function show() { alert('a :' + a); //undefined alert('b :' + b); //2 var a = 3; b = 4; alert('a :' + a); //3 } show(); alert('a- :' + a); //1 alert('b- :' + b); //4
var a = 1; b = 2; function show() { alert('a :' + a); //undefined alert('b :' + b); //2 var a = 3; b = 4; alert('a :' + a); //3 } show(); alert('a- :' + a); //1 alert('b- :' + b); //4