diff --git a/app.js b/app.js index 0d2a380..c1c82aa 100644 --- a/app.js +++ b/app.js @@ -1,5 +1,9 @@ -function sum(num1, num2) { - return num1 + num2; +function greeting() { + let message = 'Hello'; + let sayHi = function hi() { + let message = 'Hi'; + }; + sayHi(); + console.log(message); // Hello as 'Hi' is out of scope } -let result = sum(2,3); -console.log(result); \ No newline at end of file +greeting(); \ No newline at end of file