File tree 4 files changed +47
-0
lines changed
4 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ // var
2
+ const c = 3 ;
3
+ // c = 'abc';
4
+
5
+ function varTest ( ) {
6
+ var x = 0 ;
7
+ console . log ( x ) ;
8
+
9
+ if ( true ) {
10
+ var x = 1 ;
11
+ console . log ( x ) ; // 1
12
+ }
13
+
14
+ // var x = 2;
15
+ console . log ( x ) ; // 1
16
+ }
17
+
18
+
19
+ // let
20
+
21
+ function letTest ( ) {
22
+ let y = 0 ;
23
+ console . log ( y ) ;
24
+
25
+ if ( true ) {
26
+ let y = 1 ;
27
+ console . log ( y ) ; // 1
28
+ }
29
+
30
+ // let y = 2;
31
+ console . log ( y ) ; // 0
32
+ }
Original file line number Diff line number Diff line change
1
+ let name = 'Walker' ;
2
+ var z = 'zet'
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < title > Learning JavaScript - Walker</ title >
6
+ < link rel ="stylesheet " href ="style.css ">
7
+ </ head >
8
+ < body >
9
+ < h1 > Scope</ h1 >
10
+ < script src ="app.js "> </ script >
11
+ < script src ="app2.js "> </ script >
12
+ </ body >
13
+ </ html >
You can’t perform that action at this time.
0 commit comments