I am trying to set a variable from a key value pair where the key is the name of the variable.
Let's say I have :
var someValue = 10;
function setValue(key, value) {
key = value; //key is the actual name of the var i.e. "sameValue"
}
So the idea is to change the value of "someValue". Is this even possible in JavaScript?