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