Skip to content

Commit b7072e7

Browse files
committed
done objects.js
1 parent 0181fbc commit b7072e7

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

assignments/objects.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ const employeeOne = {
3131
name: 'Kennan',
3232
3333
gender: 'M',
34+
35+
// function for speak
36+
speak: function(){
37+
return "Hello, my name is Kennan!";
38+
}
3439
};
3540

3641
const employeeTwo = {
@@ -51,29 +56,32 @@ const employeeFour = {
5156
id: '5',
5257
name: 'Antonietta',
5358
54-
gender: 'F'
55-
};
59+
gender: 'F',
5660

61+
multiply: function(num1,num2) {
62+
return num1 * num2;
63+
}
64+
};
5765
// ==== Challenge 2: Reading Object Data ====
5866
// Once your objects are created, log out the following requests from HR into the console:
5967

6068
// Mitzi's name
61-
69+
console.log(employeeZero.name);
6270
// Kennan's ID
63-
71+
console.log(employeeOne.id);
6472
// Keven's email
65-
73+
console.log(employeeTwo.email);
6674
// Gannie's name
67-
75+
console.log(employeeThree.name);
6876
// Antonietta's Gender
69-
77+
console.log(employeeFour.gender);
7078
// ==== Challenge 3: Object Methods ====
7179
// Give Kennan the ability to say "Hello, my name is Kennan!" Use the console.log provided as a hint.
7280
// console.log(kennan.speak());
73-
81+
console.log(employeeOne.speak());
7482
// Antonietta loves math, give her the ability to multiply two numbers together and return the product. Use the console.log provided as a hint.
7583
//console.log(antonietta.multiplyNums(3,4));
76-
84+
console.log(employeeFour.multiply(3,4));
7785
// === Great work! === Head over to the the arrays.js. You may come back and attempt the Stretch Challenge once you have completed the challenges in arrays.js and function-conversion.js.
7886

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

0 commit comments

Comments
 (0)