You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// here we can clearly see that name is global variable because it has not declared in a function so it has global scope
function stud(){
var student =" chaitanya";
document.write(student);
}
stud();
// Here we can clearly see that chaitanya was printed only once because student is local variable it does not has global scope. So not able to use outside of function