所以我有这个继承的代码:
enemy = new Object(hawk);
家长是这样的:
function CreateEnemy(name, health, damage){
this.name = name;
this.health = health;
this.damage = damage;
}
var hawk = new CreateEnemy("Hawk", 200, 20);
每当我这样做
enemy.health -= 10;
它也改变了 hawk.health 的值,我不希望它这样做。