You are here: irt.org | FAQ | JavaScript | Object | Q827 [ previous next ]
You can use the eval() method to evaluate text strings:
<SCRIPT LANGUAGE="JavaScript"><!-- // set up 10 variables: for (var i=0; i<10; i++) eval('var var' + i + ' = ' + (i*i)); // show their value: for (var i=0; i<10; i++) alert(eval('var' + i)); //--></SCRIPT>