File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- function userFactory ( name , group , email ) {
3
+ function userFactory1 ( name , group , email ) {
4
4
return { name, group, email } ;
5
5
}
6
6
7
- /*
8
-
9
- const userFactory = (name, group, email) => ({
7
+ const userFactory2 = ( name , group , email ) => ( {
10
8
name, group, email
11
9
} ) ;
12
10
13
- const userFactory = (name, group, email) => {
11
+ const userFactory3 = ( name , group , email ) => {
14
12
name , group , email
15
13
} ;
16
14
17
- */
18
-
19
- const user1 = userFactory ( 'marcus' , 'emperors' , 'marcus@spqr.it' ) ;
15
+ const user1 = userFactory1 ( 'marcus' , 'emperors' , 'marcus@spqr.it' ) ;
20
16
console . log ( user1 ) ;
17
+
18
+ const user2 = userFactory2 ( 'marcus' , 'emperors' , 'marcus@spqr.it' ) ;
19
+ console . log ( user2 ) ;
20
+
21
+ const user3 = userFactory3 ( 'marcus' , 'emperors' , 'marcus@spqr.it' ) ;
22
+ console . log ( user3 ) ;
23
+ // Explain: why undefined
You can’t perform that action at this time.
0 commit comments