Skip to content

Commit 0efbcbf

Browse files
finished objects challenge 3
1 parent 9493470 commit 0efbcbf

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎assignments/objects.js‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,18 @@ console.log(antonietta.gender);
6565
// Give Kennan the ability to say "Hello, my name is Kennan!" Use the console.log provided as a hint.
6666
// console.log(kennan.speak());
6767

68+
kennan.speak = function() {
69+
return `Hello, my name is Kennan!`;
70+
}
71+
6872
// Antonietta loves math, give her the ability to multiply two numbers together and return the product. Use the console.log provided as a hint.
6973
//console.log(antonietta.multiplyNums(3,4));
7074

75+
antonietta.multiplyNums = function(num1, num2) {
76+
const product = num1 * num2;
77+
return `My name is Antonietta. The product is ${product}`;
78+
}
79+
7180
// === Great work! === Head over to the the arrays.js file or take a look at the stretch challenge
7281

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

0 commit comments

Comments
 (0)