Hi is it possible to set a var name from another variable?
Such as I have the var test with different numbers each time the function is called so I want the number to be a variable name e.g. var test contains ' 1 ' so the new variable would be var 1. I then want to add a word to this number "word" to make the new variable become var 1word.
var newNumber = 1;
var newNumber += 'word';
^ becomes ' 1 '
the new var name becomes ' 1word '
edit:
function getNumber(newNumber) // Gets a number, for this example say its the number '1'
{
var newNumber += "something"; //The new varaible will be named "1something" (something can be any word)
}
Hope I haven't made it sound too confusing, thanks.