The only way to achieve what you wish is through use of the eval function. Eval is also known as the "evil" function. It can introduce massive security holes to your code and is extremely inefficient. Do not use eval.
The problem is that a value assigned to a variable will always be a string, number, boolean, undefined, array, function, or object literal. You cannot assign a variable name to a another variable as a value, because when one variable is assigned to another the contents of the variable are what is actually assigned.
You are going to have to redesign the test you are trying to write to test against the supplied value explicitly instead of converting a string into a variable name.