Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Need help with Level 9 lesson 8

let mobile = {
name: "Apple iPhone 12",
price: 1200,

// defining method
purchase: function(quantity) {
console.log(`Please pay ${mobile.price*quantity} for ${quantity} ${mobile.name} Mobile phones.`);
}
};
mobile.purchase(2);

this is my code. I'm getting this error:
Complete the first template literal. And do not miss the multiplication symbol, that is there for a reason.

Can someone please help?
by

1 Answer

kshitijrana14
Try this one

let mobile = {
name: "Apple iPhone 12",
price: 1200,

// defining method
purchase:function(quantity) {
console.log(`Please pay ${(this.price)*quantity} for ${quantity} ${this.name} Mobile phones.`);
}
};

// call the method with argument = 2
mobile.purchase(2);

Login / Signup to Answer the Question.