I'm receiving a JSON answer, the point here is that every iteration has different names, so I donĀ“t know if it's possible to change the variable name dynamically in a for loop. My code below:
var content;
for(var index in data){
content += '<tr class="clickableRow">'
+'<td class="text-center">'+(index+1)+'</td>'
+'<td class="text-center">'+data[index].idpuntoventa1+'</td>'
+'<td class="text-center">'+data[index].puntoventa1+'</td>'
+'<td class="text-center">'+data[index].idtipoexhibicion1+'</td>'
+'<td class="text-center">'+data[index].tipoexhibicion1+'</td></tr>';
}
I just want to change the number at the end like: idpuntoventa2, idpuntoventa3.