let abc = "test"
function example() {
console.log("inside_block: ", abc);
}
example();
console.log("outside_block: ", abc);
inside_block: test
outside_block: test
let abc;
abc = "test";
function example() {
console.log("inside_block: ", abc);
}
example();
console.log("outside_block: ", abc);
inside_block: test
outside_block: test
let abc;
abc = "test";
function example() {
let abc = 123;
console.log("inside_block: ", abc);
}
example();
console.log("outside_block: ", abc);
inside_block: 123
outside_block: test
let abc;
abc = "test";
function example() {
abc = 123;
console.log("inside_block: ", abc);
}
example();
console.log("outside_block: ", abc);
inside_block: 123
outside_block: 123