At first I thought this was a PHP variable variable question
http://php.net/manual/en/language.variables.variable.php
but then saw it was in JavaScript.
I suppose there might be a way to do similar with JavaScript, but why?
As best as I can recall, I’ve only ever needed to use PHP variable variables once in close to 20 years.