Signup/Sign In
user profile picture

Abhishek Kumar Singh

abhishekkumarsingh

Joined 2 years ago

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

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();
2 years ago