I have a for loop in a JS snippet and I want to dynamically generate the array members' names, based on a string and the current iteration number. Basically I have written something like this:
product_data[i] = {
"ch-" + i: '1',
'product' + i: jsondata[products][i].product_description,
'quantity' + i: jsondata[products][i].quantity,
'price' + i: jsondata[products][i].unit_price,
'rem' + i: '',
'fpa' + i: jsondata[products][i].vat
};
however, it's not working at all. I've used eval() without any luck too. Any ideas?