var varname = prompt('Variable name:'); var value = 42; this[varname] = value;