@@ -18,27 +18,76 @@ const example = {
1818}
1919
2020// Write your intern objects here:
21+ const intern01 = {
22+ 'id' : 1 ,
23+ 'name' : "Mitzi" ,
24+ 'email' : "mmelloy0@psu.edu" ,
25+ 'gender' : "F"
26+ } ;
27+
28+ const intern02 = {
29+ 'id' : 2 ,
30+ 'name' : "Kennan" ,
31+ 'email' : "kdiben1@tinypic.com" ,
32+ 'gender' : "M"
33+ } ;
34+
35+ const intern03 = {
36+ 'id' : 3 ,
37+ 'name' : "Keven" ,
38+ 'email' : "kmummery2@wikimedia.org" ,
39+ 'gender' : "M"
40+ } ;
41+
42+ const intern04 = {
43+ 'id' : 4 ,
44+ 'name' : "Gannie" ,
45+ 'email' : "gmartinson3@illinois.edu" ,
46+ 'gender' : "M"
47+ } ;
48+
49+ const intern05 = {
50+ 'id' : 5 ,
51+ 'name' : "Antonietta" ,
52+ 'email' : "adaine5@samsung.com" ,
53+ 'gender' : "F"
54+ } ;
2155
2256
2357// ==== Challenge 2: Reading Object Data ====
2458// Once your objects are created, log out the following requests from HR into the console:
2559
2660// Mitzi's name
61+ console . log ( intern01 . name ) ;
2762
2863// Kennan's ID
64+ console . log ( intern02 . id ) ;
2965
3066// Keven's email
67+ console . log ( intern03 . email ) ;
3168
3269// Gannie's name
70+ console . log ( intern04 . name ) ;
3371
3472// Antonietta's Gender
73+ console . log ( intern05 . gender ) ;
74+
3575
3676// ==== Challenge 3: Object Methods ====
3777// Give Kennan the ability to say "Hello, my name is Kennan!" Use the console.log provided as a hint.
78+ intern02 . speak = function ( ) {
79+ return `Hello, my name is ${ this . name } !` ;
80+ }
81+
3882// console.log(kennan.speak());
83+ console . log ( intern02 . speak ( ) ) ;
3984
4085// Antonietta loves math, give her the ability to multiply two numbers together and return the product. Use the console.log provided as a hint.
86+ intern05 . multiplyNums = function ( num1 , num2 ) {
87+ return num1 * num2 ;
88+ }
4189//console.log(antonietta.multiplyNums(3,4));
90+ console . log ( intern05 . multiplyNums ( 10 , 10 ) ) ;
4291
4392// === Great work! === Head over to the the arrays.js file or take a look at the stretch challenge
4493
@@ -49,7 +98,13 @@ const example = {
4998// 3. Nest a grandchild object in the child object with properties for name and age. The name will be Sam and the age will be 30
5099// 4. Give each of the objects the ability to speak their names using the this keyword.
51100
52- const parent = { }
101+ const parent = {
102+ 'name' : "Susan" ,
103+ 'age' : 70 ,
104+ speak : function ( ) {
105+ return `My name is ${ this . name } ` ;
106+ }
107+ } ;
53108
54109// Log the parent object's name
55110
0 commit comments