EDIT 2 : This is my first post on stock overflow and although I sometimes have some bad, questions to ask. i thought id at least fix the formatting considering I can not delete this.
I essentially wanted to automate variable creation , although at the time I did not not such things as arrays existed surprisingly.
I want to automate the creation of this variable
var l = createSprite(200,200);
I want to be able to define one variable , with another like this :
var count = 5;
var l + count = 1;
count++;
var l + count = 2;
var l=30
var l + "foo" = 40`
if I were to run this, lfoo would be returned undefined. Why? Is this impossible? If so how can i automate defining variables?