I'm trying to display the contents of 'name' in this Object through a function;
Locations[1]= {name: "Castle", characters: [], maxCharacters: 8};
When I run this with parameters (1,1), I get; "Success, 1 moved to NaN". I tried changing '.name', with '.maxCharacters' just as a test, and it worked fine.
I tried adding .toString() to the end of .name, but it didn't work either.
Any insight to what I'm doing wrong would be greatly appreciated.
Locations[1]= {name: "Castle", characters: [], maxCharacters: 8};
Code:
var swapActorLocation = function(actorId, locationId) { if (locationId == 1 && Locations[1].maxCharacters == Locations[1].characters.length) { console.log("Party 1 is full.") } else { $dataActors[actorId.location] = locationId; console.log("Success,", + actorId + " moved to", + Locations[locationId].name); }}
I tried adding .toString() to the end of .name, but it didn't work either.
Any insight to what I'm doing wrong would be greatly appreciated.