Skip to content

Commit 31c57bb

Browse files
committed
First part of objects.js complete
1 parent 335d554 commit 31c57bb

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

assignments/objects.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,73 @@ let example = {
1919

2020
// Write your intern objects here:
2121

22+
let intern1 = {
23+
"id": 1,
24+
"name": "Mitzi",
25+
"email": "[email protected]",
26+
"gender": "F"
27+
}
28+
29+
let intern2 = {
30+
"id": 2,
31+
"name": "Kennan",
32+
"email": "[email protected]",
33+
"gender": "M",
34+
speak: function() {
35+
return "Hello, my name is Kennan!";
36+
}
37+
}
38+
39+
let intern3 = {
40+
"id": 3,
41+
"name": "Keven",
42+
"email": "[email protected]",
43+
"gender": "M"
44+
}
45+
46+
let intern4 = {
47+
"id": 4,
48+
"name": "Gannie",
49+
"email": "[email protected]",
50+
"gender": "M"
51+
}
52+
53+
let intern5 = {
54+
"id": 5,
55+
"name": "Antonietta",
56+
"email": "[email protected]",
57+
"gender": "F",
58+
multiplyNums: function(num1, num2) {
59+
return num1 * num2;
60+
}
61+
}
2262

2363
// ==== Challenge 2: Reading Object Data ====
2464
// Once your objects are created, log out the following requests from HR into the console:
2565

2666
// Mitzi's name
67+
console.log(intern1.name);
2768

2869
// Kennan's ID
70+
console.log(intern2.id);
2971

3072
// Keven's email
73+
console.log(intern3.email);
3174

3275
// Gannie's name
76+
console.log(intern4.name);
3377

3478
// Antonietta's Gender
79+
console.log(intern5.gender);
3580

3681
// ==== Challenge 3: Object Methods ====
3782
// Give Kennan the ability to say "Hello, my name is Kennan!" Use the console.log provided as a hint.
3883
// console.log(kennan.speak());
84+
console.log(intern2.speak());
3985

4086
// Antonietta loves math, give her the ability to multiply two numbers together and return the product. Use the console.log provided as a hint.
4187
//console.log(antonietta.multiplyNums(3,4));
88+
console.log(intern5.multiplyNums(3,4));
4289

4390
// === Great work! === Head over to the the arrays.js file or take a look at the stretch challenge
4491

0 commit comments

Comments
 (0)