-
hi,
i want to create new Objects dynamically, depending on an Array....
basically i wrote this function :
function theObject(name){
this._name=name;
}
-
uups
hi,
i want to create new Objects dynamically, depending on an Array....
basically i wrote this function :
function theObject(name){
this._name=name;
}
theArray=new Array("one", "two" .... "n");
for(i=0; i<theArray.length; i++){
theNewName="theItem" add i;
eval(theNewName) = new theObject(theArray[i]);
}
that only creates undefined variables named 'Item0, Item1, ..... itemN'......
please Help
THNX
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|