File tree 2 files changed +19
-13
lines changed
2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- const city = {
4
- name : 'Kiev' ,
5
- year : 482 ,
6
- f1 : function ( ) {
7
- return this . name ;
8
- } ,
9
- f2 : ( ) => {
10
- return this . name ;
11
- } ,
12
- f3 ( ) {
13
- return this . name ;
14
- }
3
+ const Context = function ( ) {
4
+ this . name = 'Marcus' ;
5
+ const city = {
6
+ name : 'Kiev' ,
7
+ year : 482 ,
8
+ f1 : function ( ) {
9
+ return this . name ;
10
+ } ,
11
+ f2 : ( ) => {
12
+ return this . name ;
13
+ } ,
14
+ f3 ( ) {
15
+ return this . name ;
16
+ }
17
+ } ;
18
+ return city ;
15
19
} ;
16
20
21
+ const city = new Context ( ) ;
22
+
17
23
console . log ( 'city.f1() = ' + city . f1 ( ) ) ;
18
24
console . log ( 'city.f2() = ' + city . f2 ( ) ) ;
19
25
console . log ( 'city.f3() = ' + city . f3 ( ) ) ;
Original file line number Diff line number Diff line change @@ -193,4 +193,4 @@ const badIntrospect = (
193
193
194
194
const iface = { common : { merge, section } } ;
195
195
console . dir ( introspect ( iface ) ) ;
196
- console . dir ( badIntrospect ( iface ) ) ;
196
+ console . dir ( badIntrospect ( iface ) , { depth : 5 } ) ;
You can’t perform that action at this time.
0 commit comments