console.log(boo);
var boo = "boo";
var boo;
console.log(boo);
boo = "boo";
function foo(){
console.log(foo);
var foo = "foo";
}
foo();
var foo = "bar";
function greet(){
console.log(foo);
var foo = "foo";
}
greet();
var foo = "bar";
function greet(){
var foo;
console.log(foo);
foo = "bar";
}
greet();
foo();
function foo(){
console.log('Hello');
}
foo();
var foo = function foo(){
console.log('Hello');
}
console.log(foo);
var foo = "foo";
function foo() {
a = 100;
var b = 200;
}
foo();
console.log(a);
console.log(b);
function bar(){
let a = b = 0;
return b;
}
bar();
function foo() {
console.log(a); // Output: ??
a = 100;
}
foo();
var a = 100;
function foo() {
console.log(a); // Output: ??
a = 200;
}
foo();
function foo(){
console.log("Hey");
}
foo();
function foo(){
console.log("Hello");
}
console.log(typeof foo);
function foo(){
return "bar";
}
var foo = "bar";
function foo(){
return "bar";
}
var foo;
console.log(typeof foo);
if(true){
function foo(){
console.log(1);
}
}else{
function foo(){
console.log(2);
}
}
foo();
function foo(){
bar();
return;
function bar(){
console.log("bar");
}
}
foo();
var x = 7,x = 8, x;
console.log(x);
function foo(x){
x();
}
foo(function(){console.log("bar")});
function foo(x){
x();
function x(){
console.log("foo");
}
}
foo(function(){console.log("bar")});
foo();
function foo() {
console.log(1);
}
var foo = function() {
console.log(2);
};
function foo() {
console.log(3);
}
foo();
let b, a;
function foo(){
let a = b = 0;
a++;
return a;
}
foo();
console.log(typeof a);
console.log(typeof b);
Option: undefined 0 1 0
Ans: undefined 0