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

Level 9, lesson 9

int level 9, lesson 9 should be taught before lesson 8 because lesson 8 includes the use of this keyword which has no been taught until lesson 9. i.e.. you are asking us to solve problem using this keyword without first telling us what it means.
by

2 Answers

sam5epi0l
Hi there, Thanks for pointing it out. We will fix the Lesson. For now you can use this solution to move forward.
let player = {
name: "default_name",
weapon: "Pistol",
exp: "Pro",

// defining method
setName: function(name) {
this.name = name;
},
getName: function() {
return this.name;
},
showInfo: function() {
console.log(`${this.getName()} uses ${this.weapon} and is ${this.exp} level player in STBattleRoyal`);
}
};

player.setName("John Wick");
player.showInfo();
Zohaib3pgva
Hi

Login / Signup to Answer the Question.