I wish to insert variables into an object key structure but I just get the variable name rather than the variable value.
var winnerId = 10;
var loserId = 11;
newMessage.setMessageData({
winnerId : {
"status" : "win",
"choice" : playerData[winnerId]["currentChoice"],
"newScore" : playerData[winnerId]["score"]
},
loserId : {
"status" : "lost",
"choice" : playerData[loserId]["currentChoice"],
"newScore" : playerData[loserId]["score"]
}
});