i have:
var optiontable = {1: 'attack', 2: 'defence', 3: 'intelligence'};
var option = 1;
var minion = minions[thisminion]; // get correct, works.
console.log(optiontable[option]); // would output "attack"
var nameoption = optiontable[option];
var increasement = 8;
how can I retrieve the minion.attack using the following notation:
thisminion.nameoption // this expression is not functional as it should display the result of thisminion.attack
and how can I use the value of nameoption in the following context:
minions.update({
_id: thisminion._id,
userid: playerid
}, {$inc: {nameoption: increasement}})