I have a list of 3 lines. I want to efficiently separate each line out as it’s own individual item.
myList = [MultiLine.attributes.renderers[0], MultiLine.attributes.renderers[1],
MultiLine.attributes.renderers[2]]
What I want:
line1 = MultiLine.attributes.renderers[0];
line2 = MultiLine.attributes.renderers[1];
line3 = MultiLine.attributes.renderers[2];
I know in Python there is the casting function which I would use like so:
line + str(i) = MultiLine.attributes.renderers[i];
However I'm getting ReferenceError: invalid assignment left-hand side with the equivalent JS:
for(var j = 0; j < myList.length; j++){
"line" + String(j) = MultiLine.attributes.renderers[j];
}
Any ideas?
I don't know how to properly go about changing the value of my variable within the for-loop. Would Break statements help?