Hello I am creating a proof of concept of a battle system. I am curious about how to extract the values of the subnames. Seen here.
function item(name, amount, type, return, descri){
this.name = name;
this.itemAmount = amount;
this.type = type;
this.returnVaule = return;
this.description = descri;
}
function person(name, hp, dex, str){
this.name = name;
this.healthPoints = hp;
this.dexPoints = dex;
this.strPoints = str;
}
var self = new person("You", 10, 5, 5)
var other = new person("Other Guy", 20, 8, 8)
var healthPotion = new item("Health Potion", potion, 5, "Heals you for five health points")
var strengthPotion = new item("Strength Potion", potion, 3, "Adds three points of Strength for one point of Dexterity")
[Test]
You have {self.healthPoints} health points.
Here are the errors I am getting:
Uncaught SyntaxError: Unexpected token return
at Object.InjectedScript.evaluateOn (:895:140)
at Object.InjectedScript.evaluateAndWrap (:828:34)
at Object.InjectedScript.evaluate (:694:21)