Syntax error in Character class example/Chapter 9
FoleyDom opened this issue · comments
if (target.health > 0) {
console.log(`${target.name} has ${target.health} health points left`);
} else {
target.health = 0;
const bonusXP = 10;
console.log(
`${this
.name} eliminated ${target.name} and wins ${bonusXP} experience points`
);
this.xp += bonusXP;
In this if statement the line
${this.name} eliminated ${target.name} and wins ${bonusXP} experience points
Should be one line.