From 6c8e1761343508ee4a088b67c74f7ac53c18b6a4 Mon Sep 17 00:00:00 2001 From: Neeru <161798182+neeru24@users.noreply.github.com> Date: Sun, 22 Sep 2024 06:08:11 +0000 Subject: [PATCH] Commit Changes --- Functions/03_scope.js | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/Functions/03_scope.js b/Functions/03_scope.js index e69de29..016a1cb 100644 --- a/Functions/03_scope.js +++ b/Functions/03_scope.js @@ -0,0 +1,58 @@ +//var c = 300 +let a = 300 +if (true) { + let a = 10 + const b = 20 + console.log("INNER: ", a); + +} + + + +// console.log(a); +// console.log(b); +// console.log(c); + + +function one(){ + const username = "neeru" + + function two(){ + const website = "youtube" + console.log(username); + } + // console.log(website); + + two() + +} + +// one() + +if (true) { + const username = "neeru" + if (username === "neeru") { + const website = " youtube" + console.log(username + website); + } + // console.log(website); +} + +// console.log(username); + + +// hoisting basicss + + +console.log(addOne(5)) + +function addOne(num){ + return num + 1 +} + + + +// addTwo(5) +const addTwo = function(num){ + return num + 2 +} \ No newline at end of file