Skip to content

Commit ebeb8f0

Browse files
committed
Udpate object factory
1 parent aaaaca1 commit ebeb8f0

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

JavaScript/1-object.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
'use strict';
22

3-
function userFactory(name, group, email) {
3+
function userFactory1(name, group, email) {
44
return { name, group, email };
55
}
66

7-
/*
8-
9-
const userFactory = (name, group, email) => ({
7+
const userFactory2 = (name, group, email) => ({
108
name, group, email
119
});
1210

13-
const userFactory = (name, group, email) => {
11+
const userFactory3 = (name, group, email) => {
1412
name, group, email
1513
};
1614

17-
*/
18-
19-
const user1 = userFactory('marcus', 'emperors', 'marcus@spqr.it');
15+
const user1 = userFactory1('marcus', 'emperors', 'marcus@spqr.it');
2016
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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy