Before you ask... I don't plan to actually do this. It's bad practice for obvious reasons. I'm just curious if it is possible.
In javascript, you can use bracket syntax to make variable-variables in global scope:
var var_name = 'my_var',
var_value = 'my_value';
window[var_name] = var_value;
alert( my_var ); // Works! alerts user: 'my_value'
However, when you're inside of a function and you use the 'var' keyword, the variables you create are locally scoped to the function they are declared in. Is there some object that can be used with the bracket syntax (like window) to get access to the locally scoped variables? Something like this:
this_function[var_name] = var_value;
I doubt it's possible, but thought I'd ask just for kicks.