Post Closed as "Duplicate" by VLAZ javascript
Users with the javascript badge or a synonym can single-handedly close javascript questions as duplicates and reopen them as needed.
Javascript Use dynamic variable namenames in JavaScript
Javascript dynamic variable name
In PHP you can do amazing/horrendous things like this:
$a = 1;
$b = 2;
$c = 3;
$name = 'a';
echo $$name;
// prints 1
Is there any way of doing something like this with Javascript?
E.g. if I have a var name = 'the name of the variable'; can I get a reference to the variable with name name?
lang-js