Skip to content

Commit 868e618

Browse files
committed
minor refactor
1 parent 14a62cb commit 868e618

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎assignments/prototypes.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function CharacterStats(attributes) {
3636
GameObject.call(this, attributes);
3737
this.healthPoints = attributes.healthPoints;
3838
this.takeDamage = function () {
39-
return `${attributes.name} took damage`;
39+
return `${this.name} took damage`;
4040
}
4141
}
4242

@@ -59,7 +59,7 @@ function Humanoid(attributes) {
5959
this.weapons = attributes.weapons;
6060
this.language = attributes.language;
6161
this.greet = function () {
62-
return `${attributes.name} offers a greeting in ${attributes.language}`;
62+
return `${this.name} offers a greeting in ${this.language}`;
6363
}
6464
}
6565

@@ -100,6 +100,7 @@ const swordsman = new Humanoid({
100100
name: 'Sir Mustachio',
101101
team: 'The Round Table',
102102
weapons: [
103+
'Giant Sword',
103104
'Giant Sword',
104105
'Shield',
105106
],

0 commit comments

Comments
 (0)