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

Javascript Level 9 Lesson 8


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

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

// call the method with argument = 2
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.