How can I dynamically set theName
and change it? Is there a way to do that?
var myTeam = new Object ();
function AddObject(theName) {
var person = new Object();
person.firstName = "John";
person.lastName = "Doe";
person.age = 50;
person.eyeColor = "blue";
myTeam.theName = person;
}
AddObject("Example1");
AddObject("Example2");
AddObject("Example3");