I am new in React.js, I am designing a little game.
When I am setting the life
value, I want to use the value of job
, can I do it in React.js?
Here is part of my code:
this.setState({
players:[
{
id:uuid.v4(),
name: "A",
job: "Wizard",
life: this.getRandHealth("Wizard")
}, {
id:uuid.v4(),
name: "B",
job: "Witch",
life: this.getRandHealth("Witch")
}]});
I want directly access job
instead of signing them manually. Can I do it?