2021-05-12 11:39:16 +10:00
|
|
|
function greeting() {
|
|
|
|
let message = 'Hello';
|
|
|
|
let sayHi = function hi() {
|
|
|
|
let message = 'Hi';
|
|
|
|
};
|
|
|
|
sayHi();
|
|
|
|
console.log(message); // Hello as 'Hi' is out of scope
|
2021-05-12 11:36:07 +10:00
|
|
|
}
|
2021-05-12 11:39:16 +10:00
|
|
|
greeting();
|