This is possible but you have to be wary of context and scope.
1. To set variable with global scope in browser environment:
window[str1 + str2] = value
2. To set variable with global scope in node environment:
global[str1 + str2] = value
3. Within a closure and scoped within that closure:
this[str1 + str2] = value
Within the closure, global and window will still set the global. Note that if you are within a function that is being called, 'this' could refer to another object.