I've got this object, which I use to create dynamic variables:
$("polyline").each(function (index) {
polylineObj["allPoints"+index] = document.getElementsByTagName("polyline")[index].getAttribute("points");
polylineObj["allPointsArray"+index] = polylineObj["allPoints"+index].split(" ");
});
But also in this function each, I have this
polylineObj["yAxis"+index] = [];
polylineObj["allPointsArray"+index].forEach(function (value, index) {
if (index % 2) {
polylineObj["yAxis"+index].push(value);
}
});
The polylineObj["yAxis"+index] works, but when I try to push the value - it doesn't work...
Not sure why. Any idea?