Say I have strings in the following format: HAMILTON.Angelica, WICKED.Glinda, HAMILTON.Eliza, HAMILTON.AndPeggy, WICKED.Elphaba
I want to create an array in this format: HAMILTON=[{Angelica, Eliza, AndPeggy}] WICKED=[{Glinda, Elphaba}]
I want it to be iterative, so I want to detect which array the string will be included one at a time. Say for example, first would be HAMILTON.Angelica, I want my code to detect if there is an array called HAMILTON (create one if there's none) and push the string after the "."
{Angelica, Eliza, AndPeggy}is not a valid javascript construct