File tree Expand file tree Collapse file tree 1 file changed +38
-6
lines changed Expand file tree Collapse file tree 1 file changed +38
-6
lines changed Original file line number Diff line number Diff line change 1
- {
2
- var a = 10
3
- let b = 100
4
- const c = 1000
5
- }
1
+ // {
2
+ // var a = 10
3
+ // let b = 100
4
+ // const c = 1000
5
+ // }
6
6
7
- console . log ( a )
7
+ // console.log(a)
8
8
// console.log(b) // Reference Error since variable declare with let is block scoped
9
9
// console.log(c) // Reference Error since variable declare with const is block scoped
10
+
11
+ var length = 10
12
+
13
+ function fn ( ) {
14
+ console . log ( this . length )
15
+ }
16
+
17
+ fn ( )
18
+
19
+ var obj2 = {
20
+ length : 5 ,
21
+ method : function ( fn ) {
22
+ fn ( )
23
+ // console.log(arguments[0]())
24
+ arguments [ 0 ] ( )
25
+ } ,
26
+ }
27
+
28
+ // obj2.method(fn, 1)
29
+ ; ( function ( ) {
30
+ console . log ( 1 )
31
+ setTimeout ( function ( ) {
32
+ console . log ( 2 )
33
+ } , 1000 )
34
+ setTimeout (
35
+ ( function ( ) {
36
+ console . log ( 3 )
37
+ } ) ( ) ,
38
+ 3000
39
+ )
40
+ console . log ( 4 )
41
+ } ) ( )
You can’t perform that action at this time.
0 commit comments