Here's the structure of my Object festivals:
Object {friday: Object}
friday: Object
amazon: Object
band: Object
Next, I've created a function called`newAct`:
function newAct(band, date, startTime, endTime, stage){
var act = new Object();
switch(date){
case "friday":
switch(stage){
case "amazon":
festival.friday.amazon.band= new Object();
break;
}
break;
}
return act;
}
My issue arises at this particular line:
festival.friday.amazon.band= new Object();
I am trying to figure out how to dynamically insert my parameter 'band' as a new property of the Amazon Object.
UPDATE
The challenge lies in naming the property 'band' after the parameter. For example, if I call`newAct("Suicide Silence", "friday", 19:30, 20:30, "StageTwo");`, the property should be named `Suicide_Silence`. Thus we would have:
festival.friday.amazon.Suicide_Silence = new Object();