I want to be able to take JSON into my program and then create objects based off of that data. So, I want to create objects where the name of that object is the value stored in a key value pair. For instance, if I had the following JSON (and I know this isn't perfect JSON):
{
"objectName" : "**variableName**",
"someDataName" : "thatData",
"someOtherDataName" : "thisData"
}
Then I want to be able to make an object like this:
function myObject(thatData, thisData) {
this.name = name;
this.thatData = thatData;
}
var **variableName** = new myObject(thatData, thisData);
The key here is that I want to be able to use the value stored in the ObjectName key value pair as the variable name for the object. Is this even possible? I have been looking for how to do this for a while now. I believe that this is different than "Variable" variables in Javascript? because I am trying to use a value in a key value pair to name my objects.