Is it possible to initialize new classes through a loop with placeholders? Sorry if I use the words incorrectly.
class Data{
constructor(id, name,car){
this.id = id;
this.name = name;
this.car = car;
}
}
function initializeClasses(){
var characters = ["A","B","C","D","E"];
var cars = ["Audi", "BMW", "Porsche", "", ""]; // Includes empty slots.
for (i = 0; i < characters.length; i++){
var str = String(i+characters[i]); // To make a new name, I want to know that because I need that for something.
let ${str} = new Data(i, characters[i], cars[i]); // The placeholder.
}
}