I have a number of arrays in a javascript file The array that I want to use in my calculations is:
var planets_num = []
If I want to use a certain array, I simply use:
arraytouse = planets_num
What I want to do is use an input:
<input type="text" id="mynewtext" value="Enter array name to use">
and then a function to get the value of "mynewtext":
function getnewform1 () {
newtext=document.getElementById('mynewtext').value
. . .
}
let's say that the var newtext = "abc" I then want:
abc = planets_num
i.e. the values from the array abc to be placed in the planets_num array
Hope this makes sense
TIA
eval.scope, so you can writescope[name] = planets_num