I am looking for a way to cast items in a loop into a different type each iteration. Something like this:
for (var i = 0; i < 100; i++)
for (var j = 0; j < 100; j++)
newArr.push({
date:arrA[i].subArr[j].myDate,
points+i:arrA[i].subArr[j].myPoints,
league+i:arrA[i].subArr[j].myLeague
});
Is such a thing possible?
Have you tried to create an object and alter the properties afterwards before adding it to the array?