So I can create a whole bunch of empty objects that are independent with my code below. Is there a better way to do this? Or is this the only method?
var array = [];
for (let i = 0; i < 5; i++)
{
array.push("temp" + i);
}
for (let item of array)
{
eval(`${item} = new Object();`);
}
temp0.first = 1;
temp4.last = "last";
for (let item of array)
{
console.log(eval(item));
}