T
Tuxedo
A likely trivial question: ...
How can a variable best be named from a parameter passed via function? For
example: ..
function makeup(x){
var ??? = document.title;
}
makeup('stripes');
... so if makeup('stripes') is run, the variable within the function would
be named 'stripes'.
More precisely, what I would like to do is to append a string to a partly
pre-named variable, while the string passed via the parameter would become
the second part of the variable name, such as:
function makeup(x){
var zebra??? = document.title;
}
makeup('stripes');
... so the variable name would then become 'zebrastripes'. What is a good
method of doing this?
Many thanks,
Tuxedo
How can a variable best be named from a parameter passed via function? For
example: ..
function makeup(x){
var ??? = document.title;
}
makeup('stripes');
... so if makeup('stripes') is run, the variable within the function would
be named 'stripes'.
More precisely, what I would like to do is to append a string to a partly
pre-named variable, while the string passed via the parameter would become
the second part of the variable name, such as:
function makeup(x){
var zebra??? = document.title;
}
makeup('stripes');
... so the variable name would then become 'zebrastripes'. What is a good
method of doing this?
Many thanks,
Tuxedo