Sorry for the ugly code and if this is an obvious question. I'm having a hard time Googling it.
I have an array like this:
var productDropArea = ['productDropArea5', 'productDropArea6','productDropArea7','productDropArea8','productDropArea9','productDropArea10'];
I also have this object with data in them :
res.assetData.productMedia5
res.assetData.productMedia6
res.assetData.productMedia7
res.assetData.productMedia8
res.assetData.productMedia9
res.assetData.productMedia10
Is there any way I can access this data through a loop dynamicly ?
I have tried something like this:
for (var i = 5, len = productDropArea.length +5 ; i < len; i++) {
console.log(res.assetData.productMedia+i);
}
Which does not work. Is there any way I could access all the res.assetData.productMedia+i
data in my loop?