It looks like you're new here. If you want to get involved, click one of these buttons!
<<set $cat to { name: "felix", //... }>> <<set $dog to { name: "lassie", //... }>>
function GetPetName(pet){ var petname = ""; if(pet == "cat"){ petname = state.active.variables.cat.name; }else if(pet == "dog"){ petname = state.active.variables.dog.name; } }
function GetPetName(pet){ var newpet = state.active.variables.pet; var petname = newpet.name; }
Comments
I'll have to compare this to what I tried last night once I'm back on that machine, because I could have sworn I tried it the same way you've presented it here. Probably missed something obvious.
edit: I had a follow up question but I realized my error immediately after posting it.