We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a27c0a commit 740a49bCopy full SHA for 740a49b
revision/rev2.js
@@ -0,0 +1,30 @@
1
+//var const let
2
+
3
+let a=5
4
+var b=1
5
+const c=3
6
7
+console.log("original values",a,b,c)
8
+a=6
9
+b=2
10
+// c=4
11
+console.log("updated values",a,b,c)//giving error bc of c
12
13
+function abcd(){
14
+ var d=3 //function scoped
15
16
17
18
+ if(1){
19
+ const e=4
20
+ let f=5 // braces scoped
21
+ console.log(e,f,d)
22
+ }
23
+ console.log(e,f)
24
25
+}
26
+abcd()
27
28
29
+// var add itself in window obj which is highly insecure for data privacy thats why let and const
30
+//were introduced which if defined in script.js will not add themself in window obj
0 commit comments