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 would i do to get the minion.attack based on:
thisminion.nameoption // this wont work when it should display the result of thisminion.attack
and get the nameoption to use in:
minions.update({
_id: thisminion._id,
userid: playerid
}, {$inc: {nameoption: increasement}})