var x = 5;
function y(){
x=10;
return
function x(){}
}
console.log(x); //5
console.log(y()); //undefined
console.log(x); //5
if i remove the line function x(){}
then expected output will be logged.
var x = 5;
function y(){
x=10;
return
function x(){}
}
console.log(x); //5
console.log(y()); //undefined
console.log(x); //5
if i remove the line function x(){}
then expected output will be logged.