Skip to content

Commit 0d73d42

Browse files
Task 2: objects.js completed
1 parent 0425ff1 commit 0d73d42

1 file changed

Lines changed: 44 additions & 8 deletions

File tree

‎assignments/objects.js‎

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,67 @@ const example = {
1515
"name": "Example",
1616
"email": "examples@you.edu",
1717
"gender": "F"
18-
}
18+
};
1919

2020
// Write your intern objects here:
21-
21+
const mitzi = {
22+
"id": 1,
23+
"name": "Mitzi",
24+
"email": "mmelloy0@psu.edu",
25+
"gender": "F",
26+
};
27+
const kennan = {
28+
"id": 2,
29+
"name": "Kennan",
30+
"email": "kdiben1@tinypic.com",
31+
"gender": "M",
32+
speak(){
33+
return `"Hello, my name is ${kennan.name}!"`;
34+
},
35+
};
36+
const keven = {
37+
"id": 3,
38+
"name": "Keven",
39+
"email": "kmummery2@wikimedia.org",
40+
"gender": "M",
41+
};
42+
const gannie = {
43+
"id": 4,
44+
"name": "Gannie",
45+
"email": "gmartinson3@illinois.edu",
46+
"gender": "M",
47+
};
48+
const antonietta = {
49+
"id": 5,
50+
"name": "Antonietta",
51+
"email": "adaine5@samsung.com",
52+
"gender": "F",
53+
multiplyNums(x, y){
54+
return x * y;
55+
}
56+
};
2257

2358
// ==== Challenge 2: Reading Object Data ====
2459
// Once your objects are created, log out the following requests from HR into the console:
2560

2661
// Mitzi's name
27-
62+
console.log(mitzi.name);
2863
// Kennan's ID
29-
64+
console.log(kennan.id);
3065
// Keven's email
31-
66+
console.log(keven.email);
3267
// Gannie's name
33-
68+
console.log(gannie.name);
3469
// Antonietta's Gender
70+
console.log(antonietta.gender);
3571

3672
// ==== Challenge 3: Object Methods ====
3773
// Give Kennan the ability to say "Hello, my name is Kennan!" Use the console.log provided as a hint.
3874
// console.log(kennan.speak());
39-
75+
console.log(kennan.speak());
4076
// Antonietta loves math, give her the ability to multiply two numbers together and return the product. Use the console.log provided as a hint.
4177
//console.log(antonietta.multiplyNums(3,4));
42-
78+
console.log(antonietta.multiplyNums(3,4));
4379
// === Great work! === Head over to the the arrays.js file or take a look at the stretch challenge
4480

4581
// ==== Stretch Challenge: Nested Objects and the this keyword ====

0 commit comments

Comments
 (0)